==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x101c/0x1090 drivers/hid/hid-mcp2221.c:964
Read of size 1 at addr ffff88813b7cbfff by task modprobe/23066
CPU: 1 UID: 0 PID: 23066 Comm: modprobe Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/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/0x1d0 mm/kasan/report.c:595
mcp2221_raw_event+0x101c/0x1090 drivers/hid/hid-mcp2221.c:964
__hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2161
hid_irq_in+0x55d/0x710 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38d/0x610 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xda1/0x36c0 drivers/usb/gadget/udc/dummy_hcd.c:2005
__run_hrtimer kernel/time/hrtimer.c:1930 [inline]
__hrtimer_run_queues+0x470/0xa00 kernel/time/hrtimer.c:1994
hrtimer_run_softirq+0x17d/0x2c0 kernel/time/hrtimer.c:2011
handle_softirqs+0x1dd/0x9e0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x160/0x210 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+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1061
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:lock_acquire+0x5e/0x370 kernel/locking/lockdep.c:5872
Code: 05 fb 66 68 0b 83 f8 07 0f 87 d9 02 00 00 48 0f a3 05 86 24 61 09 0f 82 a4 02 00 00 8b 35 0e 34 61 09 85 f6 0f 85 bf 00 00 00 <48> 8b 44 24 30 65 48 2b 05 9d 66 68 0b 0f 85 ed 02 00 00 48 83 c4
RSP: 0018:ffffc900024bf480 EFLAGS: 00000206
RAX: 0000000000000046 RBX: 0000000000000001 RCX: 0000000000000001
RDX: 0000000000000000 RSI: ffffffff890a9792 RDI: ffffffff87b08200
RBP: ffff8881f573f748 R08: 00000000655fb30a R09: 000000000000002b
R10: 0000000000000200 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
local_trylock_acquire include/linux/local_lock_internal.h:53 [inline]
alloc_from_pcs mm/slub.c:4744 [inline]
slab_alloc_node mm/slub.c:4884 [inline]
kmem_cache_alloc_noprof+0x104/0x6a0 mm/slub.c:4906
vm_area_alloc+0x1f/0x160 mm/vma_init.c:32
__mmap_new_vma mm/vma.c:2547 [inline]
__mmap_region+0xfcd/0x2a80 mm/vma.c:2771
mmap_region+0x35d/0x620 mm/vma.c:2857
do_mmap+0xc53/0x12d0 mm/mmap.c:560
vm_mmap_pgoff+0x201/0x390 mm/util.c:581
ksys_mmap_pgoff+0x3cb/0x610 mm/mmap.c:606
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0x7f0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff67e511242
Code: 08 00 04 00 00 eb e2 90 41 f7 c1 ff 0f 00 00 75 27 55 89 cd 53 48 89 fb 48 85 ff 74 33 41 89 ea 48 89 df b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 5e 5b 5d c3 0f 1f 00 c7 05 46 40 01 00 16 00
RSP: 002b:00007fffdf4f03e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff67e511242
RDX: 0000000000000001 RSI: 000000000002f6d0 RDI: 0000000000000000
RBP: 0000000000000802 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000802 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff67e4e6ab0 R14: 00007fffdf4f0860 R15: 00000ffffbe9e080
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888100000000 pfn:0x13b7cb
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 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 0, migratetype Unmovable, gfp_mask 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 22268, tgid 22268 (syz.0.3701), ts 2082427540869, free_ts 2085016085147
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1853
prep_new_page mm/page_alloc.c:1861 [inline]
get_page_from_freelist+0x20a5/0x3850 mm/page_alloc.c:3941
__alloc_frozen_pages_noprof+0x273/0x28a0 mm/page_alloc.c:5221
alloc_pages_mpol+0xe8/0x410 mm/mempolicy.c:2490
alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2581
pagetable_alloc_noprof include/linux/mm.h:3651 [inline]
pmd_alloc_one_noprof include/asm-generic/pgalloc.h:143 [inline]
__pmd_alloc+0x3b/0x8d0 mm/memory.c:6820
pmd_alloc include/linux/mm.h:3567 [inline]
__handle_mm_fault+0xe16/0x2780 mm/memory.c:6517
handle_mm_fault+0x37b/0xa30 mm/memory.c:6734
do_user_addr_fault+0x5ae/0x11d0 arch/x86/mm/fault.c:1334
handle_page_fault arch/x86/mm/fault.c:1474 [inline]
exc_page_fault+0x66/0xc0 arch/x86/mm/fault.c:1527
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618
page last free pid 22 tgid 22 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1397 [inline]
__free_frozen_pages+0x6d8/0xf60 mm/page_alloc.c:2938
__pagetable_free include/linux/mm.h:3661 [inline]
pagetable_free include/linux/mm.h:3685 [inline]
pagetable_dtor_free include/linux/mm.h:3784 [inline]
__tlb_remove_table include/asm-generic/tlb.h:221 [inline]
__tlb_remove_table_free mm/mmu_gather.c:228 [inline]
tlb_remove_table_rcu+0x2cf/0x380 mm/mmu_gather.c:291
rcu_do_batch kernel/rcu/tree.c:2617 [inline]
rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2869
handle_softirqs+0x1dd/0x9e0 kernel/softirq.c:622
run_ksoftirqd kernel/softirq.c:1076 [inline]
run_ksoftirqd+0x38/0x60 kernel/softirq.c:1068
smpboot_thread_fn+0x3d3/0xaa0 kernel/smpboot.c:160
kthread+0x370/0x450 kernel/kthread.c:436
ret_from_fork+0x69a/0xc80 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff88813b7cbe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88813b7cbf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88813b7cbf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88813b7cc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88813b7cc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 05 fb 66 68 0b add $0xb6866fb,%eax
5: 83 f8 07 cmp $0x7,%eax
8: 0f 87 d9 02 00 00 ja 0x2e7
e: 48 0f a3 05 86 24 61 bt %rax,0x9612486(%rip) # 0x961249c
15: 09
16: 0f 82 a4 02 00 00 jb 0x2c0
1c: 8b 35 0e 34 61 09 mov 0x961340e(%rip),%esi # 0x9613430
22: 85 f6 test %esi,%esi
24: 0f 85 bf 00 00 00 jne 0xe9
* 2a: 48 8b 44 24 30 mov 0x30(%rsp),%rax <-- trapping instruction
2f: 65 48 2b 05 9d 66 68 sub %gs:0xb68669d(%rip),%rax # 0xb6866d4
36: 0b
37: 0f 85 ed 02 00 00 jne 0x32a
3d: 48 rex.W
3e: 83 .byte 0x83
3f: c4 .byte 0xc4