================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x1062/0x1240 drivers/hid/hid-mcp2221.c:858 Read of size 1 at addr ffff88802f91bfff by task syz.3.957/8126 CPU: 1 PID: 8126 Comm: syz.3.957 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xa8/0x210 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 mcp2221_raw_event+0x1062/0x1240 drivers/hid/hid-mcp2221.c:858 hid_input_report+0x3ed/0x500 drivers/hid/hid-core.c:2125 hid_irq_in+0x478/0x6d0 drivers/hid/usbhid/hid-core.c:284 __usb_hcd_giveback_urb+0x35d/0x520 drivers/usb/core/hcd.c:1648 dummy_timer+0xa58/0x34e0 drivers/usb/gadget/udc/dummy_hcd.c:2017 __run_hrtimer kernel/time/hrtimer.c:1754 [inline] __hrtimer_run_queues+0x525/0xc10 kernel/time/hrtimer.c:1818 hrtimer_run_softirq+0x177/0x290 kernel/time/hrtimer.c:1835 handle_softirqs+0x27d/0x820 kernel/softirq.c:578 __do_softirq kernel/softirq.c:612 [inline] invoke_softirq kernel/softirq.c:452 [inline] __irq_exit_rcu+0xd3/0x190 kernel/softirq.c:661 irq_exit_rcu+0x9/0x20 kernel/softirq.c:673 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687 RIP: 0010:__sanitizer_cov_trace_pc+0x5c/0x60 kernel/kcov.c:234 Code: 00 16 00 00 83 fa 02 75 21 48 8b 91 08 16 00 00 48 8b 32 48 8d 7e 01 8b 89 04 16 00 00 48 39 cf 73 08 48 89 3a 48 89 44 f2 08 0f 1f 00 f3 0f 1e fa 48 8b 04 24 65 48 8b 15 60 45 7c 7e 65 8b RSP: 0018:ffffc9000ba17670 EFLAGS: 00000287 RAX: ffffffff813ba3f7 RBX: ffffc9000ba17800 RCX: 0000000000080000 RDX: ffffc9000d47c000 RSI: 00000000000008e7 RDI: 00000000000008e8 RBP: ffffc9000ba177d0 R08: ffffc9000ba17810 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000002 R12: ffffffff81dfc3fe R13: ffffc9000ba17748 R14: ffffffff81760ea0 R15: dffffc0000000000 unwind_next_frame+0x27/0x2990 arch/x86/kernel/unwind_orc.c:469 arch_stack_walk+0x144/0x190 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0xaa/0x100 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:53 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1811 [inline] slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837 slab_free mm/slub.c:3830 [inline] __kmem_cache_free+0xba/0x1f0 mm/slub.c:3843 raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1109 [inline] raw_ioctl+0x24d4/0x3d80 drivers/usb/gadget/legacy/raw_gadget.c:1280 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f8577b9dd6b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007f8575df4f60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f8577b9dd6b RDX: 00007f8575df4fe0 RSI: 0000000040085507 RDI: 0000000000000003 RBP: 0000000000000003 R08: 00007f8577f50320 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 00002000000006c0 R13: 0000000000000000 R14: 00007f8577e25fa0 R15: 00007fff0b8ebfa8 The buggy address belongs to the physical page: page:ffffea0000be46c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2f91b flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 7895, tgid 7894 (syz.0.853), ts 183119391753, free_ts 183475821747 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582 prep_new_page mm/page_alloc.c:1589 [inline] get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501 vm_area_alloc_pages mm/vmalloc.c:3120 [inline] __vmalloc_area_node mm/vmalloc.c:3189 [inline] __vmalloc_node_range+0x962/0x1320 mm/vmalloc.c:3370 vmalloc_user+0x74/0x80 mm/vmalloc.c:3524 vb2_vmalloc_alloc+0xef/0x330 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47 __vb2_buf_mem_alloc drivers/media/common/videobuf2/videobuf2-core.c:233 [inline] __vb2_queue_alloc+0x78f/0x1410 drivers/media/common/videobuf2/videobuf2-core.c:448 vb2_core_reqbufs+0x9e8/0x10d0 drivers/media/common/videobuf2/videobuf2-core.c:838 v4l2_m2m_reqbufs drivers/media/v4l2-core/v4l2-mem2mem.c:579 [inline] v4l2_m2m_ioctl_reqbufs+0x16c/0x230 drivers/media/v4l2-core/v4l2-mem2mem.c:1373 __video_do_ioctl+0xa34/0xde0 drivers/media/v4l2-core/v4l2-ioctl.c:3049 video_usercopy+0x889/0x1360 drivers/media/v4l2-core/v4l2-ioctl.c:3390 v4l2_ioctl+0x18a/0x1e0 drivers/media/v4l2-core/v4l2-dev.c:364 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1182 [inline] free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459 vfree+0x1a7/0x340 mm/vmalloc.c:2899 vb2_vmalloc_put+0x68/0xb0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:68 __vb2_buf_mem_free+0x10d/0x2c0 drivers/media/common/videobuf2/videobuf2-core.c:266 __vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:496 [inline] __vb2_queue_free+0x30c/0xbd0 drivers/media/common/videobuf2/videobuf2-core.c:525 vb2_core_queue_release+0x5f/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2471 v4l2_m2m_ctx_release+0x1e/0x40 drivers/media/v4l2-core/v4l2-mem2mem.c:1273 vicodec_release+0x97/0x110 drivers/media/test-drivers/vicodec/vicodec-core.c:1933 v4l2_release+0x1fc/0x390 drivers/media/v4l2-core/v4l2-dev.c:456 __fput+0x221/0x940 fs/file_table.c:418 task_work_run+0x1d4/0x260 kernel/task_work.c:245 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82 Memory state around the buggy address: ffff88802f91be80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802f91bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88802f91bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802f91c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802f91c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 00 16 add %dl,(%rsi) 2: 00 00 add %al,(%rax) 4: 83 fa 02 cmp $0x2,%edx 7: 75 21 jne 0x2a 9: 48 8b 91 08 16 00 00 mov 0x1608(%rcx),%rdx 10: 48 8b 32 mov (%rdx),%rsi 13: 48 8d 7e 01 lea 0x1(%rsi),%rdi 17: 8b 89 04 16 00 00 mov 0x1604(%rcx),%ecx 1d: 48 39 cf cmp %rcx,%rdi 20: 73 08 jae 0x2a 22: 48 89 3a mov %rdi,(%rdx) 25: 48 89 44 f2 08 mov %rax,0x8(%rdx,%rsi,8) * 2a: c3 ret <-- trapping instruction 2b: 0f 1f 00 nopl (%rax) 2e: f3 0f 1e fa endbr64 32: 48 8b 04 24 mov (%rsp),%rax 36: 65 48 8b 15 60 45 7c mov %gs:0x7e7c4560(%rip),%rdx # 0x7e7c459e 3d: 7e 3e: 65 gs 3f: 8b .byte 0x8b