================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff888053a2bfff by task kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Workqueue: events_power_efficient wg_ratelimiter_gc_entries Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948 __hid_input_report drivers/hid/hid-core.c:2139 [inline] hid_input_report+0x40a/0x520 drivers/hid/hid-core.c:2166 hid_irq_in+0x47e/0x6d0 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x376/0x540 drivers/usb/core/hcd.c:1661 dummy_timer+0x85f/0x44c0 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1777 [inline] __hrtimer_run_queues+0x52c/0xc60 kernel/time/hrtimer.c:1841 hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1858 handle_softirqs+0x286/0x870 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:lock_is_held_type+0xd/0x190 kernel/locking/lockdep.c:5925 Code: fc ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 55 41 57 41 56 41 55 41 54 <53> 48 83 ec 10 65 48 8b 05 26 9b 49 07 48 89 44 24 08 bb ff ff ff RSP: 0018:ffffc900000e78b0 EFLAGS: 00000202 RAX: 0000000000000001 RBX: 1ffff9200001cf24 RCX: ffff88801caf8000 RDX: 0000000000000000 RSI: 00000000ffffffff RDI: ffffffff8e13d340 RBP: ffffc900000e79f8 R08: ffffffff8ec50263 R09: 1ffffffff1d8a04c R10: dffffc0000000000 R11: fffffbfff1d8a04d R12: ffff888054e85598 R13: dffffc0000000000 R14: 0000000000000ab3 R15: ffffffffffffffa0 lock_is_held include/linux/lockdep.h:249 [inline] __might_resched+0xa6/0x610 kernel/sched/core.c:8887 wg_ratelimiter_gc_entries+0x3a6/0x450 drivers/net/wireguard/ratelimiter.c:78 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x53a2b flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 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 2, migratetype Unmovable, gfp_mask 0x40cc0(GFP_KERNEL|__GFP_COMP), pid 6091, tgid 6091 (kworker/0:5), ts 529227867497, free_ts 530055379300 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 ___kmalloc_large_node+0x5f/0x1b0 mm/slub.c:5568 __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:5599 __do_kmalloc_node mm/slub.c:5615 [inline] __kmalloc_noprof+0x4bd/0x7f0 mm/slub.c:5639 hid_alloc_buffers drivers/hid/usbhid/hid-core.c:859 [inline] usbhid_start+0x8dc/0x24b0 drivers/hid/usbhid/hid-core.c:1091 hid_hw_start+0x65/0x120 drivers/hid/hid-core.c:2374 mcp2221_probe+0x7c/0x880 drivers/hid/hid-mcp2221.c:1240 __hid_device_probe drivers/hid/hid-core.c:2775 [inline] hid_device_probe+0x416/0x7a0 drivers/hid/hid-core.c:2812 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26d/0x9e0 drivers/base/dd.c:659 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801 driver_probe_device+0x4f/0x430 drivers/base/dd.c:831 __device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959 bus_for_each_drv+0x251/0x2e0 drivers/base/bus.c:462 page last free pid 5848 tgid 5848 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 free_large_kmalloc+0x13a/0x1f0 mm/slub.c:6745 hid_free_buffers drivers/hid/usbhid/hid-core.c:976 [inline] usbhid_stop+0x695/0x890 drivers/hid/usbhid/hid-core.c:1256 release_nodes drivers/base/devres.c:505 [inline] devres_release_group+0x2ed/0x340 drivers/base/devres.c:692 hid_device_remove+0x250/0x370 drivers/hid/hid-core.c:2836 device_remove drivers/base/dd.c:569 [inline] __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x46f/0x800 drivers/base/dd.c:1297 bus_remove_device+0x34d/0x410 drivers/base/bus.c:579 device_del+0x511/0x8e0 drivers/base/core.c:3878 hid_remove_device drivers/hid/hid-core.c:3008 [inline] hid_destroy_device+0x6b/0x1b0 drivers/hid/hid-core.c:3030 usbhid_disconnect+0x9f/0xc0 drivers/hid/usbhid/hid-core.c:1462 usb_unbind_interface+0x26e/0x910 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:571 [inline] __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x4d9/0x800 drivers/base/dd.c:1297 bus_remove_device+0x34d/0x410 drivers/base/bus.c:579 device_del+0x511/0x8e0 drivers/base/core.c:3878 usb_disable_device+0x3e9/0x8a0 drivers/usb/core/message.c:1418 usb_disconnect+0x330/0x950 drivers/usb/core/hub.c:2339 Memory state around the buggy address: ffff888053a2be80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888053a2bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888053a2bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888053a2c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888053a2c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: ff 66 2e jmp *0x2e(%rsi) 3: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) a: 00 b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: f3 0f 1e fa endbr64 1f: 55 push %rbp 20: 41 57 push %r15 22: 41 56 push %r14 24: 41 55 push %r13 26: 41 54 push %r12 * 28: 53 push %rbx <-- trapping instruction 29: 48 83 ec 10 sub $0x10,%rsp 2d: 65 48 8b 05 26 9b 49 mov %gs:0x7499b26(%rip),%rax # 0x7499b5b 34: 07 35: 48 89 44 24 08 mov %rax,0x8(%rsp) 3a: bb .byte 0xbb 3b: ff (bad) 3c: ff (bad) 3d: ff .byte 0xff