================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff88805fa7bfff by task syz.3.1248/15279 CPU: 1 UID: 0 PID: 15279 Comm: syz.3.1248 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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:__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 26 ce 00 f6 48 89 df e8 0e 22 01 f6 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 e5 1e f1 f5 65 8b 05 be bb 3f 08 85 c0 74 16 5b RSP: 0018:ffffc90003cdfc60 EFLAGS: 00000246 RAX: 0000000000000006 RBX: ffff8880b8527c80 RCX: ffffffff81c374ef RDX: 0000000000000000 RSI: ffffffff8de522d8 RDI: ffffffff8c162d80 RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90ab6b97 R11: ffffffff9aff7fd0 R12: dffffc0000000000 R13: ffffc90003cdfdb8 R14: 0000000000000001 R15: ffff88802c0b2458 hrtimer_start_expires include/linux/hrtimer.h:277 [inline] hrtimer_sleeper_start_expires kernel/time/hrtimer.c:2023 [inline] do_nanosleep+0x1f7/0x570 kernel/time/hrtimer.c:2097 hrtimer_nanosleep+0x155/0x380 kernel/time/hrtimer.c:2147 common_nsleep+0xa1/0xd0 kernel/time/posix-timers.c:1353 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1399 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1376 [inline] __x64_sys_clock_nanosleep+0x34d/0x4a0 kernel/time/posix-timers.c:1376 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6d061c14a5 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 f6 54 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 4f 55 ff ff 48 8b 04 24 48 83 c4 28 f7 d8 RSP: 002b:00007f6d06fb0f60 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f6d061c14a5 RDX: 00007f6d06fb0fa0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000200000000040 R13: 0000000000000000 R14: 00007f6d063c5fa0 R15: 00007ffea1f6f948 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffffffffffffffff pfn:0x5fa7b flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 00000000ffffffff 0000000000000000 raw: ffffffffffffffff 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 12804, tgid 12804 (sed), ts 481289907837, free_ts 492224794429 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_slab_page mm/slub.c:2492 [inline] allocate_slab mm/slub.c:2660 [inline] new_slab+0x247/0x330 mm/slub.c:2714 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992 __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] kmem_cache_alloc_noprof+0xef/0x3b0 mm/slub.c:4247 mt_alloc_one lib/maple_tree.c:176 [inline] mas_alloc_nodes+0x18b/0x8b0 lib/maple_tree.c:1255 mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1337 mas_preallocate+0x7e0/0xde0 lib/maple_tree.c:5537 vma_iter_prealloc mm/vma.h:462 [inline] __split_vma+0x34a/0x1070 mm/vma.c:528 vms_gather_munmap_vmas+0x3b1/0x1340 mm/vma.c:1380 __mmap_prepare mm/vma.c:2359 [inline] __mmap_region+0x436/0x27b0 mm/vma.c:2651 mmap_region+0x1ab/0x3f0 mm/vma.c:2739 do_mmap+0xa3e/0x1210 mm/mmap.c:558 page last free pid 13022 tgid 13022 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 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+0x69/0x90 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4191 [inline] slab_alloc_node mm/slub.c:4240 [inline] kmem_cache_alloc_noprof+0x1cb/0x3b0 mm/slub.c:4247 getname_flags.part.0+0x4c/0x550 fs/namei.c:146 getname_flags+0x93/0xf0 include/linux/audit.h:322 getname include/linux/fs.h:2918 [inline] do_sys_openat2+0xb8/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1461 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805fa7be80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805fa7bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805fa7bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805fa7c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805fa7c080: 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 26 ce 00 f6 call 0xf600ce39 13: 48 89 df mov %rbx,%rdi 16: e8 0e 22 01 f6 call 0xf6012229 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 e5 1e f1 f5 call 0xf5f11f19 34: 65 8b 05 be bb 3f 08 mov %gs:0x83fbbbe(%rip),%eax # 0x83fbbf9 3b: 85 c0 test %eax,%eax 3d: 74 16 je 0x55 3f: 5b pop %rbx