==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88811f317fff by task syz.3.2056/12655
CPU: 0 UID: 0 PID: 12655 Comm: syz.3.2056 Not tainted syzkaller #0 PREEMPT(voluntary)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
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+0x156/0x4c9 mm/kasan/report.c:482
kasan_report+0xdf/0x1a0 mm/kasan/report.c:595
mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948
__hid_input_report.constprop.0+0x314/0x460 drivers/hid/hid-core.c:2139
hid_irq_in+0x52e/0x6b0 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+0xd85/0x3670 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1777 [inline]
__hrtimer_run_queues+0x516/0x990 kernel/time/hrtimer.c:1841
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858
handle_softirqs+0x1dd/0x8f0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:__do_sys_clock_nanosleep kernel/time/posix-timers.c:1394 [inline]
RIP: 0010:__se_sys_clock_nanosleep kernel/time/posix-timers.c:1375 [inline]
RIP: 0010:__x64_sys_clock_nanosleep+0x287/0x480 kernel/time/posix-timers.c:1375
Code: 31 c0 4d 85 e4 0f 95 c0 89 44 24 08 e8 82 7a 10 00 65 48 8b 05 92 9e 2a 0b 48 ba 00 00 00 00 00 fc ff df 48 8d b8 60 05 00 00 <48> 89 fe 48 c1 ee 03 80 3c 16 00 0f 85 c9 01 00 00 48 8d b8 6c 05
RSP: 0018:ffffc90015017e70 EFLAGS: 00000283
RAX: ffff888114b20000 RBX: 1ffff92002a02fd1 RCX: ffffc90003ef1000
RDX: dffffc0000000000 RSI: ffffffff81a0c17e RDI: ffff888114b20560
RBP: ffffffff876d3c40 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffffc90015017ea8 R15: ffffffff876d3c70
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0x570 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1fe719b78e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007f1fe5c35f38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00007f1fe5c376c0 RCX: 00007f1fe719b78e
RDX: 00007f1fe5c35f90 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000040
R13: 0000000000000000 R14: 00007f1fe7455fa0 R15: 00007ffed92d8c98
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f317
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 4749, tgid 4749 (modprobe), ts 76487228102, free_ts 98332442206
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884
prep_new_page mm/page_alloc.c:1892 [inline]
get_page_from_freelist+0xd57/0x3b20 mm/page_alloc.c:3945
__alloc_frozen_pages_noprof+0x269/0x2230 mm/page_alloc.c:5240
alloc_pages_mpol+0xe8/0x410 mm/mempolicy.c:2486
alloc_slab_page mm/slub.c:3075 [inline]
allocate_slab mm/slub.c:3248 [inline]
new_slab+0x2c4/0x440 mm/slub.c:3302
___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656
__kmem_cache_alloc_bulk+0x20f/0x700 mm/slub.c:7431
refill_sheaf mm/slub.c:2650 [inline]
__prefill_sheaf_pfmemalloc+0x42/0x90 mm/slub.c:5328
kmem_cache_prefill_sheaf+0x1b7/0x420 mm/slub.c:5422
mt_get_sheaf lib/maple_tree.c:189 [inline]
mas_alloc_nodes+0x2c3/0x390 lib/maple_tree.c:1140
mas_preallocate+0x39c/0xf10 lib/maple_tree.c:5194
vma_iter_prealloc mm/vma.h:505 [inline]
vma_link+0x12c/0x750 mm/vma.c:1821
insert_vm_struct+0xf4/0x2d0 mm/vma.c:3281
__install_special_mapping mm/mmap.c:1460 [inline]
_install_special_mapping+0x187/0x3d0 mm/mmap.c:1496
map_vdso+0x1b0/0x560 arch/x86/entry/vdso/vma.c:172
arch_setup_additional_pages+0x41/0x60 arch/x86/entry/vdso/vma.c:242
page last free pid 5225 tgid 5225 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1433 [inline]
__free_frozen_pages+0x7d1/0x1010 mm/page_alloc.c:2973
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xe0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4953 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
kmem_cache_alloc_noprof+0x266/0x760 mm/slub.c:5270
getname_flags.part.0+0x4c/0x540 fs/namei.c:146
getname_flags+0x93/0xf0 include/linux/audit.h:345
getname include/linux/fs.h:2498 [inline]
getname_maybe_null include/linux/fs.h:2505 [inline]
getname_maybe_null include/linux/fs.h:2502 [inline]
vfs_fstatat+0xe1/0xf0 fs/stat.c:370
__do_sys_newfstatat+0x9d/0x120 fs/stat.c:542
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0x570 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88811f317e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88811f317f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88811f317f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88811f318000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88811f318080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 31 c0 xor %eax,%eax
2: 4d 85 e4 test %r12,%r12
5: 0f 95 c0 setne %al
8: 89 44 24 08 mov %eax,0x8(%rsp)
c: e8 82 7a 10 00 call 0x107a93
11: 65 48 8b 05 92 9e 2a mov %gs:0xb2a9e92(%rip),%rax # 0xb2a9eab
18: 0b
19: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx
20: fc ff df
23: 48 8d b8 60 05 00 00 lea 0x560(%rax),%rdi
* 2a: 48 89 fe mov %rdi,%rsi <-- trapping instruction
2d: 48 c1 ee 03 shr $0x3,%rsi
31: 80 3c 16 00 cmpb $0x0,(%rsi,%rdx,1)
35: 0f 85 c9 01 00 00 jne 0x204
3b: 48 rex.W
3c: 8d .byte 0x8d
3d: b8 .byte 0xb8
3e: 6c insb (%dx),%es:(%rdi)
3f: 05 .byte 0x5