================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff888135087fff by task kworker/0:5/5285 CPU: 0 UID: 0 PID: 5285 Comm: kworker/0:5 Not tainted syzkaller #0 PREEMPT(voluntary) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 Workqueue: pm pm_runtime_work 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:2139 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:1777 [inline] __hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1841 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858 handle_softirqs+0x208/0x8d0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xfa/0x160 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+0x90/0xb0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:194 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 36 02 14 fa 48 89 df e8 1e 56 14 fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 85 b1 07 fa 65 8b 05 de 0f 51 05 85 c0 74 16 5b RSP: 0018:ffffc90003faf6e0 EFLAGS: 00000246 RAX: 0000000000000006 RBX: ffff8881f59258c0 RCX: 0000000000000006 RDX: 0000000000000000 RSI: ffffffff88c86f47 RDI: ffffffff87897540 RBP: 0000000000000287 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff8aa0d0d7 R11: 0000000000000001 R12: 1ffff920007f5edf R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 __try_to_del_timer_sync+0x115/0x170 kernel/time/timer.c:1466 __timer_delete_sync+0xf4/0x1b0 kernel/time/timer.c:1620 hub_quiesce+0x1b6/0x320 drivers/usb/core/hub.c:1409 hub_suspend+0x541/0xa80 drivers/usb/core/hub.c:4002 usb_suspend_interface drivers/usb/core/driver.c:1323 [inline] usb_suspend_both+0x302/0xc70 drivers/usb/core/driver.c:1445 usb_runtime_suspend+0x49/0x180 drivers/usb/core/driver.c:1997 __rpm_callback+0xc8/0x610 drivers/base/power/runtime.c:406 rpm_callback+0x1b7/0x200 drivers/base/power/runtime.c:460 rpm_suspend+0x2e1/0x11d0 drivers/base/power/runtime.c:698 __pm_runtime_suspend+0xba/0x1a0 drivers/base/power/runtime.c:1167 pm_runtime_autosuspend include/linux/pm_runtime.h:415 [inline] usb_runtime_idle+0x7e/0x90 drivers/usb/core/driver.c:2034 rpm_idle+0x32a/0x780 drivers/base/power/runtime.c:550 pm_runtime_work+0x120/0x150 drivers/base/power/runtime.c:995 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56d/0x700 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:0x135087 flags: 0x200000000000000(node=0|zone=2) raw: 0200000000000000 0000000000000000 00000000ffffffff 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 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5653, tgid 5653 (udevd), ts 1626541826815, free_ts 1677820597275 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x1003/0x2dc0 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x259/0x21f0 mm/page_alloc.c:5183 alloc_pages_mpol+0xe4/0x410 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3039 [inline] allocate_slab mm/slub.c:3212 [inline] new_slab+0x24a/0x360 mm/slub.c:3266 ___slab_alloc+0xdb7/0x1a70 mm/slub.c:4636 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4755 __slab_alloc_node mm/slub.c:4831 [inline] slab_alloc_node mm/slub.c:5253 [inline] kmem_cache_alloc_noprof+0x393/0x6c0 mm/slub.c:5272 getname_flags.part.0+0x4c/0x550 fs/namei.c:146 getname_flags+0x93/0xf0 include/linux/audit.h:345 getname include/linux/fs.h:2922 [inline] do_sys_openat2+0xb8/0x1d0 fs/open.c:1431 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1463 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 page last free pid 14307 tgid 14307 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x78f/0x1000 mm/page_alloc.c:2906 discard_slab mm/slub.c:3310 [inline] __put_partials+0x130/0x170 mm/slub.c:3857 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4955 [inline] slab_alloc_node mm/slub.c:5265 [inline] kmem_cache_alloc_noprof+0x260/0x6c0 mm/slub.c:5272 __kernfs_new_node+0xd2/0x8e0 fs/kernfs/dir.c:637 kernfs_new_node+0x13c/0x1e0 fs/kernfs/dir.c:713 __kernfs_create_file+0x53/0x350 fs/kernfs/file.c:1057 sysfs_add_file_mode_ns+0x207/0x3c0 fs/sysfs/file.c:313 sysfs_merge_group+0x1aa/0x340 fs/sysfs/group.c:376 dpm_sysfs_add+0x237/0x280 drivers/base/power/sysfs.c:704 device_add+0x9a6/0x1aa0 drivers/base/core.c:3649 usb_create_ep_devs+0x160/0x2b0 drivers/usb/core/endpoint.c:170 create_intf_ep_devs.isra.0+0x161/0x200 drivers/usb/core/message.c:1252 usb_set_configuration+0x11a7/0x1e20 drivers/usb/core/message.c:2216 Memory state around the buggy address: ffff888135087e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888135087f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888135087f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888135088000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888135088080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: f5 cmc 1: 53 push %rbx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 89 fb mov %rdi,%rbx a: 48 83 c7 18 add $0x18,%rdi e: e8 36 02 14 fa call 0xfa140249 13: 48 89 df mov %rbx,%rdi 16: e8 1e 56 14 fa call 0xfa145639 1b: f7 c5 00 02 00 00 test $0x200,%ebp 21: 75 23 jne 0x46 23: 9c pushf 24: 58 pop %rax 25: f6 c4 02 test $0x2,%ah 28: 75 37 jne 0x61 * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 85 b1 07 fa call 0xfa07b1b9 34: 65 8b 05 de 0f 51 05 mov %gs:0x5510fde(%rip),%eax # 0x5511019 3b: 85 c0 test %eax,%eax 3d: 74 16 je 0x55 3f: 5b pop %rbx