==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975
Read of size 1 at addr ffff8881148abfff by task syz.4.1352/10556
CPU: 1 UID: 0 PID: 10556 Comm: syz.4.1352 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/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:__sanitizer_cov_trace_pc+0x0/0x70 kernel/kcov.c:206
Code: 76 92 5d 00 48 89 df 5b e9 bd 31 62 00 be 03 00 00 00 5b e9 02 80 28 01 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1e fa 65 48 8b 05 cc 71 6f 0b 48 8b 34 24 65 48 8b 15 b0 71
RSP: 0018:ffffc90013477c50 EFLAGS: 00000202
RAX: 0000000000000002 RBX: ffffc90013477d60 RCX: ffffffff81a11e72
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88811b309e40
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff88811b309e40
R13: fffff5200268efb6 R14: dffffc0000000000 R15: 0000000000000001
hrtimer_sleeper_start_expires+0x118/0x170 kernel/time/hrtimer.c:2360
do_nanosleep+0xf7/0x500 kernel/time/hrtimer.c:2433
hrtimer_nanosleep+0x14f/0x350 kernel/time/hrtimer.c:2482
common_nsleep+0xa1/0xd0 kernel/time/posix-timers.c:1360
__do_sys_clock_nanosleep kernel/time/posix-timers.c:1406 [inline]
__se_sys_clock_nanosleep kernel/time/posix-timers.c:1383 [inline]
__x64_sys_clock_nanosleep+0x336/0x480 kernel/time/posix-timers.c:1383
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:0x7f82b30dea0e
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:00007f82b1b75f38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00007f82b1b776c0 RCX: 00007f82b30dea0e
RDX: 00007f82b1b75f90 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00002000000000c0
R13: 0000000000000000 R14: 00007f82b33a5fa0 R15: 00007ffe32f487b8
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1148ab
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 3849, tgid 3849 (modprobe), ts 75176866499
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]
__mmap_new_vma mm/vma.c:2669 [inline]
__mmap_region+0x1362/0x3130 mm/vma.c:2889
mmap_region+0x3db/0x6d0 mm/vma.c:2974
do_mmap+0x12b6/0x1c10 mm/mmap.c:573
vm_mmap_pgoff+0x1f0/0x390 mm/util.c:581
ksys_mmap_pgoff+0xe4/0x610 mm/mmap.c:619
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:96 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:89
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
page last free pid 2974 tgid 2974 ts 113460374478 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]
kmem_cache_alloc_noprof+0x264/0x650 mm/slub.c:5010
alloc_filename fs/namei.c:147 [inline]
do_getname+0x35/0x390 fs/namei.c:187
getname_flags fs/namei.c:230 [inline]
class_filename_flags_constructor include/linux/fs.h:2586 [inline]
user_path_at+0x26/0x60 fs/namei.c:3640
ksys_umount fs/namespace.c:2067 [inline]
__do_sys_umount fs/namespace.c:2075 [inline]
__se_sys_umount fs/namespace.c:2073 [inline]
__x64_sys_umount+0x10a/0x1a0 fs/namespace.c:2073
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:
ffff8881148abe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881148abf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881148abf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881148ac000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881148ac080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 76 92 jbe 0xffffff94
2: 5d pop %rbp
3: 00 48 89 add %cl,-0x77(%rax)
6: df 5b e9 fistps -0x17(%rbx)
9: bd 31 62 00 be mov $0xbe006231,%ebp
e: 03 00 add (%rax),%eax
10: 00 00 add %al,(%rax)
12: 5b pop %rbx
13: e9 02 80 28 01 jmp 0x128801a
18: 66 90 xchg %ax,%ax
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 90 nop
20: 90 nop
21: 90 nop
22: 90 nop
23: 90 nop
24: 90 nop
25: 90 nop
26: 90 nop
27: 90 nop
28: 90 nop
29: 90 nop
* 2a: f3 0f 1e fa endbr64 <-- trapping instruction
2e: 65 48 8b 05 cc 71 6f mov %gs:0xb6f71cc(%rip),%rax # 0xb6f7202
35: 0b
36: 48 8b 34 24 mov (%rsp),%rsi
3a: 65 gs
3b: 48 rex.W
3c: 8b .byte 0x8b
3d: 15 .byte 0x15
3e: b0 71 mov $0x71,%al