==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88814272ffff by task syz.2.3764/21179
CPU: 0 UID: 0 PID: 21179 Comm: syz.2.3764 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:__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 06 11 38 fa 48 89 df e8 ee 5e 38 fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 e5 e9 2b fa 65 8b 05 5e 40 75 05 85 c0 74 16 5b
RSP: 0018:ffffc9001355fc10 EFLAGS: 00000246
RAX: 0000000000000002 RBX: ffff88810a310000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff88dec6f5 RDI: ffffffff878e97a0
RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001
R13: ffff88810a3100b8 R14: ffff88810a3100b8 R15: ffff88813535586c
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
dummy_queue+0x3c5/0xb90 drivers/usb/gadget/udc/dummy_hcd.c:744
usb_ep_queue+0xf8/0x380 drivers/usb/gadget/udc/core.c:303
raw_process_ep_io+0x64d/0xc40 drivers/usb/gadget/legacy/raw_gadget.c:1114
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1153 [inline]
raw_ioctl+0x25a/0x2b80 drivers/usb/gadget/legacy/raw_gadget.c:1325
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
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:0x7f96680dab4b
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007f9666b35f60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f96680dab4b
RDX: 00007f9666b35fe0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007f9668480320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 0000200000000040
R13: 0000000000000000 R14: 00007f9668355fa0 R15: 00007ffd8ba38f38
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88814272f140 pfn:0x14272f
flags: 0x200000000000000(node=0|zone=2)
page_type: f0(buddy)
raw: 0200000000000000 ffffea0004ff4688 ffffea0004e9d3c8 0000000000000000
raw: ffff88814272f140 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 0xcc0(GFP_KERNEL), pid 18099, tgid 18099 (syz-executor), ts 1999809830314, free_ts 2120870985820
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_noprof mm/page_alloc.c:5274 [inline]
alloc_pages_bulk_noprof+0x73f/0x12c0 mm/page_alloc.c:5194
___alloc_pages_bulk mm/kasan/shadow.c:345 [inline]
__kasan_populate_vmalloc_do mm/kasan/shadow.c:370 [inline]
__kasan_populate_vmalloc+0xf0/0x210 mm/kasan/shadow.c:424
kasan_populate_vmalloc include/linux/kasan.h:580 [inline]
alloc_vmap_area+0x935/0x2a00 mm/vmalloc.c:2124
__get_vm_area_node+0x1ca/0x330 mm/vmalloc.c:3219
__vmalloc_node_range_noprof+0x213/0x1530 mm/vmalloc.c:4011
vmalloc_user_noprof+0x9e/0xe0 mm/vmalloc.c:4205
kcov_ioctl+0x4c/0x720 kernel/kcov.c:716
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
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
page last free pid 1120 tgid 1120 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
kasan_depopulate_vmalloc_pte+0x5d/0x80 mm/kasan/shadow.c:484
apply_to_pte_range mm/memory.c:3182 [inline]
apply_to_pmd_range mm/memory.c:3226 [inline]
apply_to_pud_range mm/memory.c:3262 [inline]
apply_to_p4d_range mm/memory.c:3298 [inline]
__apply_to_page_range+0xb1d/0x1520 mm/memory.c:3334
__kasan_release_vmalloc+0xd7/0xe0 mm/kasan/shadow.c:602
kasan_release_vmalloc include/linux/kasan.h:593 [inline]
kasan_release_vmalloc_node mm/vmalloc.c:2282 [inline]
purge_vmap_node+0x1c6/0xaa0 mm/vmalloc.c:2299
__purge_vmap_area_lazy+0x8e5/0xbc0 mm/vmalloc.c:2389
drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2423
process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x5da/0xe40 kernel/workqueue.c:3421
kthread+0x3b3/0x730 kernel/kthread.c:463
ret_from_fork+0x6c3/0xa20 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Memory state around the buggy address:
ffff88814272fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88814272ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88814272ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888142730000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888142730080: 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 06 11 38 fa call 0xfa381119
13: 48 89 df mov %rbx,%rdi
16: e8 ee 5e 38 fa call 0xfa385f09
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 e9 2b fa call 0xfa2bea19
34: 65 8b 05 5e 40 75 05 mov %gs:0x575405e(%rip),%eax # 0x5754099
3b: 85 c0 test %eax,%eax
3d: 74 16 je 0x55
3f: 5b pop %rbx