================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff888128b97fff by task kworker/0:1/10 CPU: 0 UID: 0 PID: 10 Comm: kworker/0:1 Not tainted syzkaller #0 PREEMPT(voluntary) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1a0 mm/kasan/report.c:595 mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948 __hid_input_report.constprop.0+0x314/0x460 drivers/hid/hid-core.c:2139 hid_irq_in+0x52e/0x6b0 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x38d/0x610 drivers/usb/core/hcd.c:1657 usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741 dummy_timer+0xd85/0x3670 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1777 [inline] __hrtimer_run_queues+0x516/0x990 kernel/time/hrtimer.c:1841 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858 handle_softirqs+0x1dd/0x8f0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xed/0x150 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:find_stack lib/stackdepot.c:602 [inline] RIP: 0010:stack_depot_save_flags+0x192/0x9c0 lib/stackdepot.c:668 Code: f8 09 49 8b 0e 49 39 ce 75 1a e9 ab 00 00 00 66 0f 1f 84 00 00 00 00 00 48 8b 09 49 39 ce 0f 84 22 02 00 00 44 39 49 10 75 ee <44> 3b 79 14 75 e8 31 c0 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 2e RSP: 0018:ffffc900000af4f0 EFLAGS: 00000246 RAX: 0000000009f12d79 RBX: 0000000000000001 RCX: ffff88811a525760 RDX: ffffffff815939aa RSI: 00000000cd3f5f01 RDI: 0000000000000003 RBP: 0000000000000c00 R08: 00000000002a2680 R09: 00000000ae62a268 R10: 0000000000000200 R11: 0000000000005939 R12: ffffc900000af548 R13: 000000000000000c R14: ffff8881f3ca2680 R15: 000000000000000c kasan_save_stack+0x3f/0x50 mm/kasan/common.c:58 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:957 [inline] usb_control_msg+0xbc/0x4a0 drivers/usb/core/message.c:144 get_bMaxPacketSize0+0xf0/0x2b0 drivers/usb/core/hub.c:4851 hub_port_init+0xc2d/0x3810 drivers/usb/core/hub.c:5112 hub_port_connect drivers/usb/core/hub.c:5496 [inline] hub_port_connect_change drivers/usb/core/hub.c:5707 [inline] port_event drivers/usb/core/hub.c:5871 [inline] hub_event+0x2f27/0x4af0 drivers/usb/core/hub.c:5953 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3421 kthread+0x3b3/0x730 kernel/kthread.c:463 ret_from_fork+0x6c3/0xa20 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888128b97cc0 pfn:0x128b97 flags: 0x200000000000000(node=0|zone=2) raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000 raw: ffff888128b97cc0 ffff888124949180 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 10354, tgid 10354 (syz-executor), ts 1751487943723, free_ts 1755841642488 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0xd57/0x3b20 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x269/0x2230 mm/page_alloc.c:5240 alloc_pages_mpol+0xe8/0x410 mm/mempolicy.c:2486 alloc_frozen_pages_noprof mm/mempolicy.c:2557 [inline] alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2577 pagetable_alloc_noprof include/linux/mm.h:3190 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:76 [inline] pte_alloc_one+0x1e/0x3e0 arch/x86/mm/pgtable.c:18 __pte_alloc+0x6d/0x3f0 mm/memory.c:453 copy_pte_range mm/memory.c:1237 [inline] copy_pmd_range mm/memory.c:1392 [inline] copy_pud_range mm/memory.c:1429 [inline] copy_p4d_range mm/memory.c:1453 [inline] copy_page_range+0x1605/0x25e0 mm/memory.c:1535 dup_mmap+0xbb3/0x1c30 mm/mmap.c:1827 dup_mm kernel/fork.c:1529 [inline] copy_mm kernel/fork.c:1581 [inline] copy_process+0x718c/0x77a0 kernel/fork.c:2221 kernel_clone+0xfc/0x930 kernel/fork.c:2651 __do_sys_clone+0xd9/0x120 kernel/fork.c:2792 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xc9/0x570 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6381 tgid 6381 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x7d1/0x1010 mm/page_alloc.c:2973 __pagetable_free include/linux/mm.h:3200 [inline] pagetable_free include/linux/mm.h:3224 [inline] pagetable_dtor_free include/linux/mm.h:3328 [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+0x2b2/0x390 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0x7c0/0x15c0 kernel/rcu/tree.c:2857 handle_softirqs+0x1dd/0x8f0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xed/0x150 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 Memory state around the buggy address: ffff888128b97e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888128b97f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888128b97f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888128b98000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888128b98080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 49 8b 0e mov (%r14),%rcx 3: 49 39 ce cmp %rcx,%r14 6: 75 1a jne 0x22 8: e9 ab 00 00 00 jmp 0xb8 d: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) 14: 00 00 16: 48 8b 09 mov (%rcx),%rcx 19: 49 39 ce cmp %rcx,%r14 1c: 0f 84 22 02 00 00 je 0x244 22: 44 39 49 10 cmp %r9d,0x10(%rcx) 26: 75 ee jne 0x16 * 28: 44 3b 79 14 cmp 0x14(%rcx),%r15d <-- trapping instruction 2c: 75 e8 jne 0x16 2e: 31 c0 xor %eax,%eax 30: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) 37: 00 00 00 00 3b: 66 data16 3c: 66 data16 3d: 2e cs