================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975 Read of size 1 at addr ffff88811b673fff by task udevd/2865 CPU: 1 UID: 0 PID: 2865 Comm: udevd Not tainted syzkaller #0 PREEMPT(lazy) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 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+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975 __hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2175 hid_irq_in+0x55d/0x710 drivers/hid/usbhid/hid-core.c:287 __usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657 usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741 dummy_timer+0xdaf/0x3820 drivers/usb/gadget/udc/dummy_hcd.c:2023 __run_hrtimer kernel/time/hrtimer.c:2074 [inline] __hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2131 hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2148 handle_softirqs+0x1d9/0x9b0 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0x168/0x210 kernel/softirq.c:758 irq_exit_rcu+0x9/0x30 kernel/softirq.c:775 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:lock_release+0x19e/0x310 kernel/locking/lockdep.c:5968 Code: ff 65 0f c1 05 bb d8 93 0b 83 f8 01 0f 85 27 01 00 00 9c 58 f6 c4 02 0f 85 12 01 00 00 41 f7 c6 00 02 00 00 0f 85 c8 00 00 00 <48> 8b 44 24 10 65 48 2b 05 5d 95 93 0b 0f 85 4d 01 00 00 48 83 c4 RSP: 0018:ffffc9000150faa8 EFLAGS: 00000206 RAX: 0000000000000046 RBX: ffff888117059b40 RCX: ffffc9000150fab4 RDX: 0000000000000000 RSI: ffffffff892bdfc5 RDI: ffffffff87d2bd80 RBP: ffffffff8208e415 R08: 000000000007a5aa R09: 00000000000001b2 R10: 0000000000000200 R11: 0000000000000000 R12: ffff88811706bc80 R13: ffffffff8208e415 R14: 0000000000000283 R15: 0000000000000001 __might_fault+0x10c/0x140 mm/memory.c:7482 _inline_copy_from_user include/linux/uaccess.h:169 [inline] _copy_from_user+0x29/0xd0 lib/usercopy.c:18 copy_from_user include/linux/uaccess.h:222 [inline] copy_msghdr_from_user+0x9f/0x4c0 net/socket.c:2643 sendmsg_copy_msghdr net/socket.c:2744 [inline] ___sys_sendmsg+0x106/0x1e0 net/socket.c:2763 __sys_sendmsg+0x160/0x210 net/socket.c:2799 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6de9480407 Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007fffa09035d0 EFLAGS: 00000202 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f6de9392880 RCX: 00007f6de9480407 RDX: 0000000000000000 RSI: 00007fffa0903630 RDI: 0000000000000004 RBP: 00005642f2519ec0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000008a R13: 00005642f22bdd80 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11b673 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 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 7050, tgid 7050 (modprobe), ts 192789952780 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0xf4b/0x3440 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2d7/0x2f70 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab mm/slub.c:3462 [inline] new_slab+0xa9/0x6e0 mm/slub.c:3513 refill_objects+0xe3/0x410 mm/slub.c:7418 refill_sheaf mm/slub.c:2885 [inline] __prefill_sheaf_pfmemalloc+0x5f/0xb0 mm/slub.c:5086 kmem_cache_prefill_sheaf+0x1bd/0x450 mm/slub.c:5174 mt_get_sheaf lib/maple_tree.c:154 [inline] mas_alloc_nodes lib/maple_tree.c:1116 [inline] mas_preallocate+0x65a/0xee0 lib/maple_tree.c:5057 vma_iter_prealloc mm/vma.h:665 [inline] vma_link+0x14a/0x8c0 mm/vma.c:1929 insert_vm_struct+0x1f7/0x890 mm/vma.c:3441 __install_special_mapping+0x452/0x9d0 mm/vma.c:3497 map_vdso+0x1b0/0x540 arch/x86/entry/vdso/vma.c:191 arch_setup_additional_pages+0x41/0x60 arch/x86/entry/vdso/vma.c:263 load_elf_binary+0x1f38/0x50a0 fs/binfmt_elf.c:1291 search_binary_handler fs/exec.c:1779 [inline] exec_binprm fs/exec.c:1811 [inline] bprm_execve fs/exec.c:1867 [inline] bprm_execve+0x8cb/0x17e0 fs/exec.c:1843 kernel_execve+0x31e/0x3a0 fs/exec.c:2011 page last free pid 8116 tgid 8114 ts 230080169411 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x714/0xfc0 mm/page_alloc.c:2962 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:361 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4683 [inline] slab_alloc_node mm/slub.c:4996 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_node_track_caller_noprof+0x2db/0x820 mm/slub.c:5545 memdup_user+0x2a/0xe0 mm/util.c:221 raw_alloc_io_data drivers/usb/gadget/legacy/raw_gadget.c:674 [inline] raw_alloc_io_data+0x186/0x1c0 drivers/usb/gadget/legacy/raw_gadget.c:660 raw_ioctl_ep0_write drivers/usb/gadget/legacy/raw_gadget.c:764 [inline] raw_ioctl+0x1332/0x2b80 drivers/usb/gadget/legacy/raw_gadget.c:1313 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88811b673e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811b673f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811b673f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811b674000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811b674080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: ff 65 0f jmp *0xf(%rbp) 3: c1 05 bb d8 93 0b 83 roll $0x83,0xb93d8bb(%rip) # 0xb93d8c5 a: f8 clc b: 01 0f add %ecx,(%rdi) d: 85 27 test %esp,(%rdi) f: 01 00 add %eax,(%rax) 11: 00 9c 58 f6 c4 02 0f add %bl,0xf02c4f6(%rax,%rbx,2) 18: 85 12 test %edx,(%rdx) 1a: 01 00 add %eax,(%rax) 1c: 00 41 f7 add %al,-0x9(%rcx) 1f: c6 00 02 movb $0x2,(%rax) 22: 00 00 add %al,(%rax) 24: 0f 85 c8 00 00 00 jne 0xf2 * 2a: 48 8b 44 24 10 mov 0x10(%rsp),%rax <-- trapping instruction 2f: 65 48 2b 05 5d 95 93 sub %gs:0xb93955d(%rip),%rax # 0xb939594 36: 0b 37: 0f 85 4d 01 00 00 jne 0x18a 3d: 48 rex.W 3e: 83 .byte 0x83 3f: c4 .byte 0xc4