================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff888140c37fff by task syz.6.2931/18189 CPU: 0 UID: 0 PID: 18189 Comm: syz.6.2931 Not tainted syzkaller #0 PREEMPT(voluntary) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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+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:__sanitizer_cov_trace_pc+0x66/0x70 kernel/kcov.c:235 Code: 82 50 15 00 00 83 f8 02 75 20 48 8b 8a 58 15 00 00 8b 92 54 15 00 00 48 8b 01 48 83 c0 01 48 39 d0 73 07 48 89 01 48 89 34 c1 d5 c2 c8 05 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90001b5fe68 EFLAGS: 00000287 RAX: 000000000000565f RBX: 0000000000000001 RCX: ffffc90017c67000 RDX: 0000000000080000 RSI: ffffffff81eea8d3 RDI: 0000000000000001 RBP: 0000000000000003 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: ffff8881354e52c0 R13: 0000000000000003 R14: 00007f561fb4dfe0 R15: 0000000000000003 __fget_files_rcu fs/file.c:1006 [inline] __fget_files+0x63/0x3c0 fs/file.c:1071 __fget_light fs/file.c:1173 [inline] fdget+0x1a9/0x210 fs/file.c:1181 class_fd_constructor include/linux/file.h:83 [inline] __do_sys_ioctl fs/ioctl.c:585 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x87/0x210 fs/ioctl.c:583 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 RIP: 0033:0x7f56210eebcb 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:00007f561fb4cf10 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f56210eebcb RDX: 00007f561fb4dfe0 RSI: 0000000080085502 RDI: 0000000000000003 RBP: 00007f561fb4dfe0 R08: 0000000000000000 R09: 00362e6364755f79 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000080085502 R13: 0000000800000000 R14: 0000200000000100 R15: 00007f562117d52a The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888100000000 pfn:0x140c37 flags: 0x200000000000000(node=0|zone=2) raw: 0200000000000000 0000000000000000 00000000ffffffff 0000000000000000 raw: ffff888100000000 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 16554, tgid 16554 (dhcpcd-run-hook), ts 1226393686028, free_ts 1255460078426 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 __kmem_cache_alloc_bulk+0x1fb/0x6d0 mm/slub.c:7375 refill_sheaf mm/slub.c:2617 [inline] kmem_cache_prefill_sheaf+0x1c3/0x430 mm/slub.c:5396 mt_get_sheaf lib/maple_tree.c:187 [inline] mas_alloc_nodes lib/maple_tree.c:1138 [inline] mas_preallocate+0xb00/0x11f0 lib/maple_tree.c:5192 vma_iter_prealloc mm/vma.h:442 [inline] vma_link+0x12e/0x6a0 mm/vma.c:1792 insert_vm_struct+0xf4/0x2d0 mm/vma.c:3197 __install_special_mapping mm/mmap.c:1461 [inline] _install_special_mapping+0x187/0x3d0 mm/mmap.c:1497 map_vdso+0x1a3/0x580 arch/x86/entry/vdso/vma.c:172 arch_setup_additional_pages+0x41/0x60 arch/x86/entry/vdso/vma.c:242 load_elf_binary+0x1d7b/0x4ef0 fs/binfmt_elf.c:1291 search_binary_handler fs/exec.c:1670 [inline] exec_binprm fs/exec.c:1702 [inline] bprm_execve fs/exec.c:1754 [inline] bprm_execve+0x8c3/0x1600 fs/exec.c:1730 page last free pid 12744 tgid 12744 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 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 Memory state around the buggy address: ffff888140c37e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888140c37f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888140c37f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888140c38000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888140c38080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 50 push %rax 1: 15 00 00 83 f8 adc $0xf8830000,%eax 6: 02 75 20 add 0x20(%rbp),%dh 9: 48 8b 8a 58 15 00 00 mov 0x1558(%rdx),%rcx 10: 8b 92 54 15 00 00 mov 0x1554(%rdx),%edx 16: 48 8b 01 mov (%rcx),%rax 19: 48 83 c0 01 add $0x1,%rax 1d: 48 39 d0 cmp %rdx,%rax 20: 73 07 jae 0x29 22: 48 89 01 mov %rax,(%rcx) 25: 48 89 34 c1 mov %rsi,(%rcx,%rax,8) * 29: e9 d5 c2 c8 05 jmp 0x5c8c303 <-- trapping instruction 2e: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 33: 90 nop 34: 90 nop 35: 90 nop 36: 90 nop 37: 90 nop 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 90 nop