================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff888060a67fff by task syz.3.780/9027 CPU: 1 UID: 0 PID: 9027 Comm: syz.3.780 Not tainted syzkaller #0 PREEMPT(full) 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+0x311/0x450 drivers/hid/hid-core.c:2130 hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x388/0x610 drivers/usb/core/hcd.c:1661 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745 dummy_timer+0x1814/0x3a30 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+0x219/0x8e0 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0x109/0x170 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+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:finish_task_switch.isra.0+0x22a/0xc10 kernel/sched/core.c:5225 Code: fb 09 00 00 44 8b 05 09 8c 22 0f 45 85 c0 0f 85 be 01 00 00 4c 89 e7 e8 a4 f6 ff ff e8 4f 65 3a 00 fb 65 48 8b 1d ae c3 4d 12 <48> 8d bb 18 16 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 RSP: 0018:ffffc900038c76f0 EFLAGS: 00000202 RAX: 00000000000095f7 RBX: ffff88806d052440 RCX: ffffffff81c380af RDX: 0000000000000000 RSI: ffffffff8de52fc1 RDI: ffffffff8c163380 RBP: ffffc900038c7738 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90ab7697 R11: 0000000000000000 R12: ffff8880b853a300 R13: ffff888023b74880 R14: ffff8880b843a300 R15: ffff8880b853b130 context_switch kernel/sched/core.c:5360 [inline] __schedule+0x1198/0x5de0 kernel/sched/core.c:6961 __schedule_loop kernel/sched/core.c:7043 [inline] schedule+0xe7/0x3a0 kernel/sched/core.c:7058 schedule_timeout+0x257/0x290 kernel/time/sleep_timeout.c:75 do_wait_for_common kernel/sched/completion.c:100 [inline] __wait_for_common+0x2ff/0x4e0 kernel/sched/completion.c:121 rdmsr_safe_on_cpu+0x1dc/0x210 arch/x86/lib/msr-smp.c:181 msr_read+0x19d/0x250 arch/x86/kernel/msr.c:66 vfs_read+0x1e4/0xcf0 fs/read_write.c:570 ksys_read+0x12a/0x250 fs/read_write.c:715 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7effd4b8eec9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007effd5abb038 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007effd4de5fa0 RCX: 00007effd4b8eec9 RDX: 0000000000018ff8 RSI: 0000200000002700 RDI: 0000000000000004 RBP: 00007effd4c11f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007effd4de6038 R14: 00007effd4de5fa0 R15: 00007ffdfc194438 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x2000000a9 pfn:0x60a67 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea000174f008 ffffea0001829988 0000000000000000 raw: 00000002000000a9 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 0x500cc2(GFP_HIGHUSER|__GFP_ACCOUNT), pid 8964, tgid 8962 (syz.3.763), ts 336138364474, free_ts 336138781959 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+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline] alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2507 anon_pipe_get_page fs/pipe.c:124 [inline] anon_pipe_write+0xbc2/0x1a90 fs/pipe.c:513 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x7d0/0x11d0 fs/read_write.c:686 ksys_write+0x1f8/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 8963 tgid 8962 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 __folio_put+0x329/0x450 mm/swap.c:112 folio_put include/linux/mm.h:1360 [inline] put_page include/linux/mm.h:1429 [inline] anon_pipe_put_page fs/pipe.c:139 [inline] anon_pipe_buf_release+0x40a/0x520 fs/pipe.c:147 pipe_buf_release include/linux/pipe_fs_i.h:282 [inline] pipe_update_tail fs/pipe.c:242 [inline] anon_pipe_read+0x5cd/0x1210 fs/pipe.c:361 io_iter_do_read io_uring/rw.c:828 [inline] __io_read+0x354/0x14a0 io_uring/rw.c:944 io_read+0x1e/0x70 io_uring/rw.c:1023 __io_issue_sqe+0xe5/0x7c0 io_uring/io_uring.c:1771 io_issue_sqe+0x86/0xe50 io_uring/io_uring.c:1794 io_queue_sqe io_uring/io_uring.c:2023 [inline] io_submit_sqe io_uring/io_uring.c:2283 [inline] io_submit_sqes+0x94b/0x25c0 io_uring/io_uring.c:2396 __do_sys_io_uring_enter+0xd6a/0x1630 io_uring/io_uring.c:3463 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888060a67e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888060a67f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888060a67f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888060a68000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888060a68080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: fb sti 1: 09 00 or %eax,(%rax) 3: 00 44 8b 05 add %al,0x5(%rbx,%rcx,4) 7: 09 8c 22 0f 45 85 c0 or %ecx,-0x3f7abaf1(%rdx,%riz,1) e: 0f 85 be 01 00 00 jne 0x1d2 14: 4c 89 e7 mov %r12,%rdi 17: e8 a4 f6 ff ff call 0xfffff6c0 1c: e8 4f 65 3a 00 call 0x3a6570 21: fb sti 22: 65 48 8b 1d ae c3 4d mov %gs:0x124dc3ae(%rip),%rbx # 0x124dc3d8 29: 12 * 2a: 48 8d bb 18 16 00 00 lea 0x1618(%rbx),%rdi <-- trapping instruction 31: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 38: fc ff df 3b: 48 89 fa mov %rdi,%rdx 3e: 48 rex.W 3f: c1 .byte 0xc1