================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff88812bc3ffff by task syz.1.4265/23789 CPU: 1 UID: 0 PID: 23789 Comm: syz.1.4265 Not tainted syzkaller #0 PREEMPT(voluntary) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 __hid_input_report.constprop.0+0x314/0x450 drivers/hid/hid-core.c:2130 hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x38b/0x610 drivers/usb/core/hcd.c:1661 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745 dummy_timer+0x1809/0x3a00 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1761 [inline] __hrtimer_run_queues+0x1ff/0xad0 kernel/time/hrtimer.c:1825 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1842 handle_softirqs+0x208/0x8d0 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xfa/0x160 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:__sanitizer_cov_trace_pc+0x56/0x70 kernel/kcov.c:222 Code: 00 f0 00 75 35 8b 82 74 15 00 00 85 c0 74 2b 8b 82 50 15 00 00 83 f8 02 75 20 48 8b 8a 58 15 00 00 8b 92 54 15 00 00 48 8b 01 <48> 83 c0 01 48 39 d0 73 07 48 89 01 48 89 34 c1 e9 45 d3 c2 05 0f RSP: 0018:ffffc9000b5679b8 EFLAGS: 00000246 RAX: 00000000000000b1 RBX: 00007ff02cb6eacb RCX: ffffc900171c9000 RDX: 0000000000080000 RSI: ffffffff818f026e RDI: 00007ff02cb6eacb RBP: 00007ff02cb6eacb R08: 0ac0d5affe09d4ff R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff81697060 R13: ffffc9000b567ad8 R14: 0000000000000000 R15: ffff88810c6d9d00 rcu_read_lock include/linux/rcupdate.h:839 [inline] is_bpf_text_address+0xe/0x1a0 kernel/bpf/core.c:776 kernel_text_address kernel/extable.c:125 [inline] kernel_text_address+0x8d/0x100 kernel/extable.c:94 __kernel_text_address+0xd/0x40 kernel/extable.c:79 unwind_get_return_address+0x59/0xa0 arch/x86/kernel/unwind_orc.c:369 arch_stack_walk+0xa6/0x100 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x3e/0x50 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2422 [inline] slab_free mm/slub.c:4695 [inline] kfree+0x283/0x470 mm/slub.c:4894 raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1153 [inline] raw_ioctl+0xab6/0x2c30 drivers/usb/gadget/legacy/raw_gadget.c:1324 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl fs/ioctl.c:584 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4d0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff02cb6eacb 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:00007ff02b5cdf70 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007ff02cb6eacb RDX: 00007ff02b5cdff0 RSI: 0000000040085507 RDI: 0000000000000003 RBP: 0000000000000003 R08: 00007ff02cef0320 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 0000200000000040 R13: 0000000000000000 R14: 00007ff02cdc5fa0 R15: 00007ffdfc32aee8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12bc3f flags: 0x200000000000000(node=0|zone=2) raw: 0200000000000000 ffffea0004db1d08 ffffea0004af0f88 0000000000000000 raw: 0000000000000000 ffff888132f66360 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 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 23610, tgid 23610 (sed), ts 1988931940575, free_ts 1989065004779 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0xf98/0x2ce0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x259/0x21e0 mm/page_alloc.c:5148 alloc_pages_mpol+0xe4/0x410 mm/mempolicy.c:2416 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline] alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2507 pagetable_alloc_noprof include/linux/mm.h:2881 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:75 [inline] pte_alloc_one+0x1c/0x3a0 arch/x86/mm/pgtable.c:18 do_fault_around mm/memory.c:5525 [inline] do_read_fault mm/memory.c:5564 [inline] do_fault mm/memory.c:5707 [inline] do_pte_missing mm/memory.c:4234 [inline] handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault+0x1ece/0x3210 mm/memory.c:6195 handle_mm_fault+0x589/0xd10 mm/memory.c:6364 do_user_addr_fault+0x613/0x1240 arch/x86/mm/fault.c:1336 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x5c/0xb0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 22 tgid 22 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x78a/0xfd0 mm/page_alloc.c:2895 pagetable_free include/linux/mm.h:2898 [inline] pagetable_dtor_free include/linux/mm.h:2996 [inline] __tlb_remove_table include/asm-generic/tlb.h:220 [inline] __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x116/0x1a0 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0x79c/0x1530 kernel/rcu/tree.c:2861 handle_softirqs+0x208/0x8d0 kernel/softirq.c:579 run_ksoftirqd kernel/softirq.c:968 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:960 smpboot_thread_fn+0x3f7/0xae0 kernel/smpboot.c:160 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56d/0x700 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88812bc3fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812bc3ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88812bc3ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812bc40000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812bc40080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 00 f0 add %dh,%al 2: 00 75 35 add %dh,0x35(%rbp) 5: 8b 82 74 15 00 00 mov 0x1574(%rdx),%eax b: 85 c0 test %eax,%eax d: 74 2b je 0x3a f: 8b 82 50 15 00 00 mov 0x1550(%rdx),%eax 15: 83 f8 02 cmp $0x2,%eax 18: 75 20 jne 0x3a 1a: 48 8b 8a 58 15 00 00 mov 0x1558(%rdx),%rcx 21: 8b 92 54 15 00 00 mov 0x1554(%rdx),%edx 27: 48 8b 01 mov (%rcx),%rax * 2a: 48 83 c0 01 add $0x1,%rax <-- trapping instruction 2e: 48 39 d0 cmp %rdx,%rax 31: 73 07 jae 0x3a 33: 48 89 01 mov %rax,(%rcx) 36: 48 89 34 c1 mov %rsi,(%rcx,%rax,8) 3a: e9 45 d3 c2 05 jmp 0x5c2d384 3f: 0f .byte 0xf