==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:957
Read of size 1 at addr ffff888129f9ffff by task kworker/0:6/5433
CPU: 0 UID: 0 PID: 5433 Comm: kworker/0:6 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Workqueue: usb_hub_wq hub_event
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+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:957
__hid_input_report.constprop.0+0x314/0x460 drivers/hid/hid-core.c:2147
hid_irq_in+0x52e/0x6b0 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38d/0x610 drivers/usb/core/hcd.c:1659
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1743
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:kcov_remote_stop+0x1a6/0x540 kernel/kcov.c:1082
Code: c7 43 28 00 00 00 00 48 89 df 48 8d 35 00 00 00 00 e8 7e 61 dc ff 48 85 ed 0f 85 f5 01 00 00 9c 58 f6 c4 02 0f 85 47 02 00 00 <48> 83 c4 20 4c 89 e7 5b 5d 41 5c 41 5d 41 5e 41 5f e9 d4 f5 ff ff
RSP: 0018:ffffc900032a79a0 EFLAGS: 00000246
RAX: 0000000000000002 RBX: ffff8881f5628e88 RCX: 0000000000000040
RDX: 0000000000000000 RSI: ffffffff890c74da RDI: ffffffff87b07b80
RBP: 0000000000000200 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff888113c3a800
R13: ffffc90011a0a000 R14: ffffc9000fa06000 R15: ffff888113c3a808
hub_event+0xdc6/0x4af0 drivers/usb/core/hub.c:5998
process_one_work+0xa0e/0x1980 kernel/workqueue.c:3302
process_scheduled_works kernel/workqueue.c:3385 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3466
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
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888100000000 pfn:0x129f9f
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 0000000000000000 00000000ffffffff 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 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 25350, tgid 25350 (cmp), ts 2412993699606, free_ts 2482650784536
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858
prep_new_page mm/page_alloc.c:1866 [inline]
get_page_from_freelist+0xf34/0x3a90 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x273/0x28a0 mm/page_alloc.c:5226
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:7255
refill_sheaf mm/slub.c:2816 [inline]
__prefill_sheaf_pfmemalloc+0x5f/0xb0 mm/slub.c:4968
kmem_cache_prefill_sheaf+0x1ba/0x4b0 mm/slub.c:5057
mt_get_sheaf lib/maple_tree.c:154 [inline]
mas_alloc_nodes lib/maple_tree.c:1119 [inline]
mas_preallocate+0xa48/0x14a0 lib/maple_tree.c:4961
vma_iter_prealloc mm/vma.h:577 [inline]
__mmap_new_vma mm/vma.c:2556 [inline]
__mmap_region+0x11b9/0x2a20 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+0xe4/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
page last free pid 5242 tgid 5242 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1402 [inline]
__free_frozen_pages+0x692/0xf10 mm/page_alloc.c:2943
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:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4569 [inline]
slab_alloc_node mm/slub.c:4898 [inline]
__kmalloc_cache_noprof+0x254/0x6b0 mm/slub.c:5414
kmalloc_noprof include/linux/slab.h:950 [inline]
usb_control_msg+0xbc/0x4b0 drivers/usb/core/message.c:157
get_port_status drivers/usb/core/hub.c:607 [inline]
hub_ext_port_status+0x152/0x600 drivers/usb/core/hub.c:624
usb_hub_port_status drivers/usb/core/hub.c:674 [inline]
hub_port_wait_reset drivers/usb/core/hub.c:2974 [inline]
hub_port_reset+0x347/0x1c60 drivers/usb/core/hub.c:3093
hub_port_init+0x6da/0x3810 drivers/usb/core/hub.c:5056
hub_port_connect drivers/usb/core/hub.c:5496 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5707 [inline]
port_event drivers/usb/core/hub.c:5871 [inline]
hub_event+0x2f27/0x4af0 drivers/usb/core/hub.c:5953
process_one_work+0xa0e/0x1980 kernel/workqueue.c:3302
process_scheduled_works kernel/workqueue.c:3385 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3466
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:
ffff888129f9fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888129f9ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888129f9ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888129fa0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888129fa0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: c7 43 28 00 00 00 00 movl $0x0,0x28(%rbx)
7: 48 89 df mov %rbx,%rdi
a: 48 8d 35 00 00 00 00 lea 0x0(%rip),%rsi # 0x11
11: e8 7e 61 dc ff call 0xffdc6194
16: 48 85 ed test %rbp,%rbp
19: 0f 85 f5 01 00 00 jne 0x214
1f: 9c pushf
20: 58 pop %rax
21: f6 c4 02 test $0x2,%ah
24: 0f 85 47 02 00 00 jne 0x271
* 2a: 48 83 c4 20 add $0x20,%rsp <-- trapping instruction
2e: 4c 89 e7 mov %r12,%rdi
31: 5b pop %rbx
32: 5d pop %rbp
33: 41 5c pop %r12
35: 41 5d pop %r13
37: 41 5e pop %r14
39: 41 5f pop %r15
3b: e9 d4 f5 ff ff jmp 0xfffff614