==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x101c/0x1090 drivers/hid/hid-mcp2221.c:964
Read of size 1 at addr ffff88813d0effff by task syz.9.1282/12448
CPU: 1 UID: 0 PID: 12448 Comm: syz.9.1282 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:hrtimer_get_softexpires include/linux/hrtimer.h:116 [inline]
RIP: 0010:hrtimer_start_expires include/linux/hrtimer.h:231 [inline]
RIP: 0010:hrtimer_sleeper_start_expires kernel/time/hrtimer.c:2216 [inline]
RIP: 0010:do_nanosleep+0xfe/0x570 kernel/time/hrtimer.c:2290
Code: 89 84 24 50 17 00 00 0f 1f 44 00 00 e8 cb 68 42 fa 49 8d 7c 24 18 be 04 00 00 00 e8 fc 29 a8 fa b8 01 20 00 00 41 87 44 24 18 <48> 8b 44 24 20 48 c1 e8 03 42 80 3c 30 00 0f 85 cc 03 00 00 48 8b
RSP: 0018:ffffc900074e7c60 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffffc900074e7d58 RCX: ffffffff87706ce4
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff888116ca1dd8
RBP: ffffc900074e7d20 R08: 0000000000000001 R09: ffffed1022d943bb
R10: ffff888116ca1ddb R11: 0000000000000000 R12: ffff888116ca1dc0
R13: fffff52000e9cfb5 R14: dffffc0000000000 R15: 0000000000000001
hrtimer_nanosleep+0x14f/0x350 kernel/time/hrtimer.c:2339
common_nsleep+0xa1/0xd0 kernel/time/posix-timers.c:1345
__do_sys_clock_nanosleep kernel/time/posix-timers.c:1391 [inline]
__se_sys_clock_nanosleep kernel/time/posix-timers.c:1368 [inline]
__x64_sys_clock_nanosleep+0x336/0x480 kernel/time/posix-timers.c:1368
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:0x7f95ca65d68e
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:00007f95c90edf38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00007f95c90ef6c0 RCX: 00007f95ca65d68e
RDX: 00007f95c90edf90 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000140
R13: 0000000000000000 R14: 00007f95ca915fa0 R15: 00007ffdbc77a388
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88813d0ef140 pfn:0x13d0ef
flags: 0x200000000000000(node=0|zone=2)
page_type: f0(buddy)
raw: 0200000000000000 ffffea0004d08608 ffffea0004880848 0000000000000000
raw: ffff88813d0ef140 0000000000000000 00000000f0000000 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8119, tgid 8119 (modprobe), ts 429537918392, free_ts 512927275230
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_slab_page mm/slub.c:3278 [inline]
allocate_slab mm/slub.c:3467 [inline]
new_slab+0xa6/0x6b0 mm/slub.c:3525
refill_objects+0x277/0x420 mm/slub.c:7272
refill_sheaf mm/slub.c:2816 [inline]
__pcs_replace_empty_main+0x375/0x650 mm/slub.c:4652
alloc_from_pcs mm/slub.c:4750 [inline]
slab_alloc_node mm/slub.c:4884 [inline]
kmem_cache_alloc_noprof+0x520/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
vm_mmap+0x8e/0xc0 mm/util.c:617
elf_map fs/binfmt_elf.c:400 [inline]
elf_load+0x2b1/0x720 fs/binfmt_elf.c:423
load_elf_binary+0x144e/0x50d0 fs/binfmt_elf.c:1188
search_binary_handler fs/exec.c:1664 [inline]
exec_binprm fs/exec.c:1696 [inline]
bprm_execve fs/exec.c:1748 [inline]
bprm_execve+0x8ef/0x16c0 fs/exec.c:1724
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
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:
ffff88813d0efe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88813d0eff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88813d0eff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88813d0f0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88813d0f0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 89 84 24 50 17 00 00 mov %eax,0x1750(%rsp)
7: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
c: e8 cb 68 42 fa call 0xfa4268dc
11: 49 8d 7c 24 18 lea 0x18(%r12),%rdi
16: be 04 00 00 00 mov $0x4,%esi
1b: e8 fc 29 a8 fa call 0xfaa82a1c
20: b8 01 20 00 00 mov $0x2001,%eax
25: 41 87 44 24 18 xchg %eax,0x18(%r12)
* 2a: 48 8b 44 24 20 mov 0x20(%rsp),%rax <-- trapping instruction
2f: 48 c1 e8 03 shr $0x3,%rax
33: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1)
38: 0f 85 cc 03 00 00 jne 0x40a
3e: 48 rex.W
3f: 8b .byte 0x8b