================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff88815ef03fff by task kworker/0:6/17478 CPU: 0 UID: 0 PID: 17478 Comm: kworker/0:6 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:write_comp_data+0x2b/0x90 kernel/kcov.c:272 Code: 8b 05 39 2b 1a 0b 49 89 f8 49 89 f1 49 89 d2 65 48 8b 3d 10 2b 1a 0b a9 00 01 ff 00 74 1b f6 c4 01 74 07 a9 00 00 ff 00 74 05 c0 34 a5 05 8b 87 64 15 00 00 85 c0 74 f1 8b 87 40 15 00 00 83 RSP: 0018:ffffc9000419e840 EFLAGS: 00000297 RAX: 0000000000000002 RBX: ffff88815c81df00 RCX: ffffffff8242eea6 RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff88813c471d40 RBP: ffff8881353bc5a0 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001 R13: ffff8881353bc5a0 R14: ffff88815c81df00 R15: dffffc0000000000 kernfs_root+0x86/0x2a0 fs/kernfs/kernfs-internal.h:76 kernfs_link_sibling+0x518/0x770 fs/kernfs/dir.c:398 kernfs_add_one+0x1e7/0x850 fs/kernfs/dir.c:815 kernfs_create_link+0x1a9/0x240 fs/kernfs/symlink.c:48 sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44 sysfs_do_create_link fs/sysfs/symlink.c:80 [inline] sysfs_create_link+0x61/0xc0 fs/sysfs/symlink.c:92 bus_add_device+0x16e/0x4a0 drivers/base/bus.c:544 device_add+0x9cf/0x1950 drivers/base/core.c:3646 i2c_register_adapter+0x39e/0x1240 drivers/i2c/i2c-core-base.c:1573 i2c_add_adapter drivers/i2c/i2c-core-base.c:1673 [inline] i2c_add_adapter+0x10a/0x1a0 drivers/i2c/i2c-core-base.c:1653 devm_i2c_add_adapter+0x1b/0x90 drivers/i2c/i2c-core-base.c:1845 mcp2221_probe.cold+0x5de/0xab3 drivers/hid/hid-mcp2221.c:1289 __hid_device_probe drivers/hid/hid-core.c:2775 [inline] hid_device_probe+0x50e/0x800 drivers/hid/hid-core.c:2812 call_driver_probe drivers/base/dd.c:581 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:659 __driver_probe_device+0x1de/0x400 drivers/base/dd.c:801 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831 __device_attach_driver+0x1df/0x340 drivers/base/dd.c:959 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500 __device_attach+0x1e4/0x4d0 drivers/base/dd.c:1031 device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1086 bus_probe_device+0x64/0x160 drivers/base/bus.c:574 device_add+0x11d9/0x1950 drivers/base/core.c:3689 hid_add_device+0x2bf/0x440 drivers/hid/hid-core.c:2951 usbhid_probe+0xd57/0x1350 drivers/hid/usbhid/hid-core.c:1450 usb_probe_interface+0x303/0x8f0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:581 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:659 __driver_probe_device+0x1de/0x400 drivers/base/dd.c:801 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831 __device_attach_driver+0x1df/0x340 drivers/base/dd.c:959 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500 __device_attach+0x1e4/0x4d0 drivers/base/dd.c:1031 device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1086 bus_probe_device+0x64/0x160 drivers/base/bus.c:574 device_add+0x11d9/0x1950 drivers/base/core.c:3689 usb_set_configuration+0xd97/0x1c60 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xa1/0xe0 drivers/usb/core/generic.c:250 usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:581 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:659 __driver_probe_device+0x1de/0x400 drivers/base/dd.c:801 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831 __device_attach_driver+0x1df/0x340 drivers/base/dd.c:959 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500 __device_attach+0x1e4/0x4d0 drivers/base/dd.c:1031 device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1086 bus_probe_device+0x64/0x160 drivers/base/bus.c:574 device_add+0x11d9/0x1950 drivers/base/core.c:3689 usb_new_device.cold+0x685/0x115c drivers/usb/core/hub.c:2695 hub_port_connect drivers/usb/core/hub.c:5567 [inline] hub_port_connect_change drivers/usb/core/hub.c:5707 [inline] port_event drivers/usb/core/hub.c:5871 [inline] hub_event+0x314d/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:0x0 pfn:0x15ef03 flags: 0x200000000000000(node=0|zone=2) raw: 0200000000000000 ffffea0004510948 ffffea0004510988 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 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 8680, tgid 8680 (udevd), ts 2776048476126, free_ts 2776260698084 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] __pud_alloc_one_noprof include/asm-generic/pgalloc.h:181 [inline] pud_alloc_one_noprof include/asm-generic/pgalloc.h:206 [inline] __pud_alloc+0x3b/0x760 mm/memory.c:6642 pud_alloc include/linux/mm.h:3100 [inline] copy_pud_range mm/memory.c:1409 [inline] copy_p4d_range mm/memory.c:1453 [inline] copy_page_range+0x20c6/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 8382 tgid 8382 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: ffff88815ef03e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88815ef03f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88815ef03f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88815ef04000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88815ef04080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 8b 05 39 2b 1a 0b mov 0xb1a2b39(%rip),%eax # 0xb1a2b3f 6: 49 89 f8 mov %rdi,%r8 9: 49 89 f1 mov %rsi,%r9 c: 49 89 d2 mov %rdx,%r10 f: 65 48 8b 3d 10 2b 1a mov %gs:0xb1a2b10(%rip),%rdi # 0xb1a2b27 16: 0b 17: a9 00 01 ff 00 test $0xff0100,%eax 1c: 74 1b je 0x39 1e: f6 c4 01 test $0x1,%ah 21: 74 07 je 0x2a 23: a9 00 00 ff 00 test $0xff0000,%eax 28: 74 05 je 0x2f * 2a: e9 c0 34 a5 05 jmp 0x5a534ef <-- trapping instruction 2f: 8b 87 64 15 00 00 mov 0x1564(%rdi),%eax 35: 85 c0 test %eax,%eax 37: 74 f1 je 0x2a 39: 8b 87 40 15 00 00 mov 0x1540(%rdi),%eax 3f: 83 .byte 0x83