================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964 Read of size 1 at addr ffff88805b8b3fff by task syz.1.840/8519 CPU: 0 UID: 0 PID: 8519 Comm: syz.1.840 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964 __hid_input_report+0x428/0x590 drivers/hid/hid-core.c:2161 hid_irq_in+0x495/0x710 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x376/0x540 drivers/usb/core/hcd.c:1655 dummy_timer+0xbc0/0x4650 drivers/usb/gadget/udc/dummy_hcd.c:2005 __run_hrtimer kernel/time/hrtimer.c:1930 [inline] __hrtimer_run_queues+0x3c0/0xa20 kernel/time/hrtimer.c:1994 hrtimer_run_softirq+0x17a/0x240 kernel/time/hrtimer.c:2011 handle_softirqs+0x22a/0x840 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x220 kernel/softirq.c:735 irq_exit_rcu+0x9/0x30 kernel/softirq.c:752 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1061 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1061 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:188 [inline] RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:206 Code: 90 f3 0f 1e fa 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 0a c3 f7 f5 48 89 df e8 12 38 f8 f5 e8 5d d2 23 f6 fb bf 01 00 00 00 42 b7 e9 f5 65 8b 05 3b 2e 8e 07 85 c0 74 07 5b c3 cc cc cc cc RSP: 0018:ffffc900107f7890 EFLAGS: 00000206 RAX: 00000000000006e7 RBX: ffffc900107f7aa8 RCX: 0000000080000001 RDX: 0000000000000000 RSI: ffffffff8dfa43ca RDI: 0000000000000001 RBP: ffffc900107f7a08 R08: ffffffff90302af7 R09: 1ffffffff206055e R10: dffffc0000000000 R11: fffffbfff206055f R12: 7fffffffffffffff R13: 0000000000000001 R14: dffffc0000000000 R15: ffffc900107f7aa0 __wait_for_common+0x5ae/0x690 kernel/sched/completion.c:122 wait_for_common kernel/sched/completion.c:132 [inline] wait_for_completion_interruptible+0x1f/0x40 kernel/sched/completion.c:221 raw_process_ep_io+0x609/0xd90 drivers/usb/gadget/legacy/raw_gadget.c:1122 raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1153 [inline] raw_ioctl+0x252c/0x41c0 drivers/usb/gadget/legacy/raw_gadget.c:1325 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4bc359caeb Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007f4bc452df60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f4bc359caeb RDX: 00007f4bc452dfe0 RSI: 0000000040085507 RDI: 0000000000000004 RBP: 0000000000000004 R08: 00007f4bc3940320 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 00002000000006c0 R13: 0000000000000000 R14: 00007f4bc3815fa0 R15: 00007f4bc393fa48 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5b8b3 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8016, tgid 8012 (syz.0.722), ts 215264887661, free_ts 228515966307 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x22d/0x280 mm/page_alloc.c:1853 prep_new_page mm/page_alloc.c:1861 [inline] get_page_from_freelist+0x2593/0x2610 mm/page_alloc.c:3941 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5221 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab+0x77/0x660 mm/slub.c:3467 new_slab mm/slub.c:3525 [inline] refill_objects+0x339/0x3d0 mm/slub.c:7272 refill_sheaf mm/slub.c:2816 [inline] __pcs_replace_empty_main+0x321/0x720 mm/slub.c:4652 alloc_from_pcs mm/slub.c:4750 [inline] slab_alloc_node mm/slub.c:4884 [inline] kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4906 xfrm_state_alloc+0x24/0x2f0 net/xfrm/xfrm_state.c:735 xfrm_state_find+0x3b9e/0x5e90 net/xfrm/xfrm_state.c:1514 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2522 [inline] xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:2573 [inline] xfrm_resolve_and_create_bundle+0x81c/0x30a0 net/xfrm/xfrm_policy.c:2871 xfrm_lookup_with_ifid+0x28b/0x1b90 net/xfrm/xfrm_policy.c:3205 xfrm_lookup net/xfrm/xfrm_policy.c:3336 [inline] xfrm_lookup_route+0x3c/0x1c0 net/xfrm/xfrm_policy.c:3347 udp_sendmsg+0x141a/0x21a0 net/ipv4/udp.c:1409 sock_sendmsg_nosec net/socket.c:787 [inline] __sock_sendmsg net/socket.c:802 [inline] ____sys_sendmsg+0x80a/0x9f0 net/socket.c:2698 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2752 __sys_sendmmsg+0x27c/0x4e0 net/socket.c:2841 page last free pid 5648 tgid 5648 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1397 [inline] __free_frozen_pages+0xc1c/0xd30 mm/page_alloc.c:2938 __slab_free+0x274/0x2c0 mm/slub.c:5613 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4570 [inline] slab_alloc_node mm/slub.c:4899 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4906 lsm_inode_alloc security/security.c:254 [inline] security_inode_alloc+0x39/0x310 security/security.c:1215 inode_init_always_gfp+0x995/0xd50 fs/inode.c:305 inode_init_always include/linux/fs.h:2936 [inline] alloc_inode+0x82/0x1b0 fs/inode.c:352 new_inode_pseudo include/linux/fs.h:3015 [inline] sock_alloc net/socket.c:697 [inline] __sock_create+0x12d/0x9d0 net/socket.c:1628 sock_create net/socket.c:1722 [inline] __sys_socket_create net/socket.c:1759 [inline] __sys_socket+0xd6/0x1b0 net/socket.c:1806 __do_sys_socket net/socket.c:1820 [inline] __se_sys_socket net/socket.c:1818 [inline] __x64_sys_socket+0x7a/0x90 net/socket.c:1818 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805b8b3e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805b8b3f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805b8b3f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805b8b4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805b8b4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 90 nop 1: f3 0f 1e fa endbr64 5: 53 push %rbx 6: 48 89 fb mov %rdi,%rbx 9: 48 83 c7 18 add $0x18,%rdi d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi 12: e8 0a c3 f7 f5 call 0xf5f7c321 17: 48 89 df mov %rbx,%rdi 1a: e8 12 38 f8 f5 call 0xf5f83831 1f: e8 5d d2 23 f6 call 0xf623d281 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 42 b7 e9 f5 call 0xf5e9b771 <-- trapping instruction 2f: 65 8b 05 3b 2e 8e 07 mov %gs:0x78e2e3b(%rip),%eax # 0x78e2e71 36: 85 c0 test %eax,%eax 38: 74 07 je 0x41 3a: 5b pop %rbx 3b: c3 ret 3c: cc int3 3d: cc int3 3e: cc int3 3f: cc int3