================================================================== BUG: KASAN: stack-out-of-bounds in user_mode arch/x86/include/asm/ptrace.h:136 [inline] BUG: KASAN: stack-out-of-bounds in unwind_next_frame+0x17fc/0x1ef0 arch/x86/kernel/unwind_orc.c:455 Read of size 8 at addr ffffc90003cefb88 by task syz-executor.3/22145 CPU: 0 PID: 22145 Comm: syz-executor.3 Not tainted 6.2.0-rc8-next-20230220-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 user_mode arch/x86/include/asm/ptrace.h:136 [inline] unwind_next_frame+0x17fc/0x1ef0 arch/x86/kernel/unwind_orc.c:455 arch_stack_walk+0x81/0xf0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x90/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 irq_work_queue_on+0xd6/0x1a0 kernel/irq_work.c:140 irq_work_single+0x1e4/0x260 kernel/irq_work.c:211 __flush_smp_call_function_queue+0x4a3/0xad0 kernel/smp.c:668 __sysvec_call_function_single+0xce/0x4f0 arch/x86/kernel/smp.c:248 sysvec_call_function_single+0x92/0xc0 arch/x86/kernel/smp.c:243 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0010:__unix_dgram_recvmsg+0x481/0xb90 net/unix/af_unix.c:2530 Code: 08 00 00 00 00 c7 40 14 00 00 00 00 48 8b 84 24 20 01 00 00 65 48 2b 04 25 28 00 00 00 0f 85 19 06 00 00 48 81 c4 28 01 00 00 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 e8 7c 77 b6 f8 49 8d bc RSP: 0018:ffffc90003cef9a0 EFLAGS: 00000296 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffc9000dd9d000 RDX: 0000000000040000 RSI: ffffffff88ce2bee RDI: ffffc90003cef7c0 RBP: ffff88802747f780 R08: 0000000000000001 R09: ffffc90003cef7c7 R10: fffff5200079def8 R11: 0000000000000000 R12: ffff88802901b800 R13: 0000000000000000 R14: 0000000000000000 R15: ffffc90003cef940 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:653 RIP: 0000:___sys_recvmsg+0x0/0x180 net/socket.c:2755 Code: 00 00 75 1d 48 81 c4 a0 00 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 41 bc f2 ff ff ff eb b0 e8 c4 55 09 02 0f 1f 40 00 <48> b8 00 00 00 00 00 fc ff df 41 57 45 89 c7 41 56 49 89 f6 41 55 RSP: 0000:1ffff1100fa10145 EFLAGS: 00000000 ORIG_RAX: ffffffff8bfc3808 RAX: 00000000202c6300 RBX: 50cc94735ca8a700 RCX: 000000000000b189 RDX: ffffffff880cbb32 RSI: ffff888077eb7800 RDI: 0000000041b58ab3 RBP: 0000000000000000 R08: ffffc90003cefdb0 R09: 0000000000000002 R10: 0000000000000000 R11: 1ffff9200079df6e R12: ffffffff8a1611ad R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to stack of task syz-executor.3/22145 and is located at offset 24 in frame: ___sys_recvmsg+0x0/0x180 net/socket.c:2446 This frame has 3 objects: [32, 40) 'iov' [64, 72) 'uaddr' [96, 224) 'iovstack' The buggy address belongs to the virtual mapping at [ffffc90003ce8000, ffffc90003cf1000) created by: kernel_clone+0xeb/0xa10 kernel/fork.c:2684 The buggy address belongs to the physical page: page:ffffea0000f97400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3e5d0 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 22133, tgid 22133 (syz-executor.3), ts 2143868249413, free_ts 2084254355134 prep_new_page mm/page_alloc.c:2552 [inline] get_page_from_freelist+0x11bb/0x2d50 mm/page_alloc.c:4339 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5605 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 vm_area_alloc_pages mm/vmalloc.c:2942 [inline] __vmalloc_area_node mm/vmalloc.c:3010 [inline] __vmalloc_node_range+0xb8a/0x1300 mm/vmalloc.c:3180 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct kernel/fork.c:984 [inline] copy_process+0x1320/0x76c0 kernel/fork.c:2100 kernel_clone+0xeb/0xa10 kernel/fork.c:2684 __do_sys_clone+0xba/0x100 kernel/fork.c:2825 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1453 [inline] free_pcp_prepare+0x4de/0x930 mm/page_alloc.c:1503 free_unref_page_prepare mm/page_alloc.c:3401 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3496 vfree+0x180/0x7e0 mm/vmalloc.c:2741 kvfree+0x32/0x50 mm/util.c:647 __v4l2_ctrl_modify_dimensions drivers/media/v4l2-core/v4l2-ctrls-api.c:1002 [inline] __v4l2_ctrl_modify_dimensions+0x207/0x650 drivers/media/v4l2-core/v4l2-ctrls-api.c:983 v4l2_ctrl_modify_dimensions include/media/v4l2-ctrls.h:1005 [inline] vivid_update_format_cap+0x1753/0x27f0 drivers/media/test-drivers/vivid/vivid-vid-cap.c:479 vivid_s_fmt_vid_cap+0x1345/0x3250 drivers/media/test-drivers/vivid/vivid-vid-cap.c:784 fmt_sp2mp_func+0x9f/0x3c0 drivers/media/test-drivers/vivid/vivid-vid-common.c:860 vidioc_s_fmt_vid_cap+0x99/0xd0 drivers/media/usb/go7007/go7007-v4l2.c:341 vivid_s_fmt_cap+0x73/0xb0 drivers/media/test-drivers/vivid/vivid-core.c:548 v4l_s_fmt+0x5cc/0xe80 drivers/media/v4l2-core/v4l2-ioctl.c:1713 __video_do_ioctl+0xba6/0xf20 drivers/media/v4l2-core/v4l2-ioctl.c:3041 video_usercopy+0x338/0x1930 drivers/media/v4l2-core/v4l2-ioctl.c:3403 v4l2_ioctl+0x1b7/0x250 drivers/media/v4l2-core/v4l2-dev.c:364 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffffc90003cefa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 ffffc90003cefb00: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 >ffffc90003cefb80: f1 f1 00 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00 00 ^ ffffc90003cefc00: 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 00 00 ffffc90003cefc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 08 00 or %al,(%rax) 2: 00 00 add %al,(%rax) 4: 00 c7 add %al,%bh 6: 40 14 00 adc $0x0,%al 9: 00 00 add %al,(%rax) b: 00 48 8b add %cl,-0x75(%rax) e: 84 24 20 test %ah,(%rax,%riz,1) 11: 01 00 add %eax,(%rax) 13: 00 65 48 add %ah,0x48(%rbp) 16: 2b 04 25 28 00 00 00 sub 0x28,%eax 1d: 0f 85 19 06 00 00 jne 0x63c 23: 48 81 c4 28 01 00 00 add $0x128,%rsp * 2a: 44 89 e8 mov %r13d,%eax <-- trapping instruction 2d: 5b pop %rbx 2e: 5d pop %rbp 2f: 41 5c pop %r12 31: 41 5d pop %r13 33: 41 5e pop %r14 35: 41 5f pop %r15 37: c3 retq 38: e8 7c 77 b6 f8 callq 0xf8b677b9 3d: 49 rex.WB 3e: 8d .byte 0x8d 3f: bc .byte 0xbc