==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:950
Read of size 1 at addr ffff88812952ffff by task kworker/1:1/23539
CPU: 1 UID: 0 PID: 23539 Comm: kworker/1:1 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/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+0x156/0x4c9 mm/kasan/report.c:482
kasan_report+0xdf/0x1e0 mm/kasan/report.c:595
mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:950
__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:1785 [inline]
__hrtimer_run_queues+0x50e/0xa70 kernel/time/hrtimer.c:1849
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1866
handle_softirqs+0x1de/0x9d0 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:orc_ip arch/x86/kernel/unwind_orc.c:81 [inline]
RIP: 0010:__orc_find+0x86/0xf0 arch/x86/kernel/unwind_orc.c:103
Code: f2 48 d1 fa 48 8d 5c 95 00 48 89 da 48 c1 ea 03 0f b6 34 0a 48 89 da 83 e2 07 83 c2 03 40 38 f2 7c 05 40 84 f6 75 4b 48 63 13 <48> 01 da 49 39 d5 73 af 4c 8d 63 fc 49 39 ec 73 b2 4d 29 f7 49 c1
RSP: 0018:ffffc9000303e320 EFLAGS: 00000246
RAX: ffffffff8b644984 RBX: ffffffff8b0889b4 RCX: dffffc0000000000
RDX: fffffffff73e8ae9 RSI: 0000000000000000 RDI: ffffffff8b0889b4
RBP: ffffffff8b0889b4 R08: ffffffff8b64498a R09: 0000000000000007
R10: 0000000000000200 R11: 0000000000014715 R12: ffffffff8b0889b4
R13: ffffffff8247154b R14: ffffffff8b0889b4 R15: ffffffff8b0889b4
orc_find arch/x86/kernel/unwind_orc.c:238 [inline]
unwind_next_frame+0x2ec/0x1ea0 arch/x86/kernel/unwind_orc.c:510
arch_stack_walk+0x94/0xf0 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5260 [inline]
__kmalloc_node_track_caller_noprof+0x306/0x800 mm/slub.c:5368
__kmemdup_nul mm/util.c:64 [inline]
kstrdup+0x51/0xe0 mm/util.c:84
kstrdup_const+0x63/0x80 mm/util.c:104
__kernfs_new_node+0x9b/0x960 fs/kernfs/dir.c:633
kernfs_new_node+0x11b/0x1a0 fs/kernfs/dir.c:718
kernfs_create_link+0xcc/0x240 fs/kernfs/symlink.c:39
sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44
sysfs_do_create_link fs/sysfs/symlink.c:80 [inline]
sysfs_create_link+0x61/0xc0 fs/sysfs/symlink.c:92
bus_add_device+0x144/0x4a0 drivers/base/bus.c:540
device_add+0x9cf/0x1950 drivers/base/core.c:3646
i2c_register_adapter+0x39e/0x1210 drivers/i2c/i2c-core-base.c:1573
i2c_add_adapter drivers/i2c/i2c-core-base.c:1673 [inline]
i2c_add_adapter+0x10a/0x1a0 drivers/i2c/i2c-core-base.c:1653
devm_i2c_add_adapter+0x1b/0x90 drivers/i2c/i2c-core-base.c:1845
mcp2221_probe.cold+0x5de/0xab3 drivers/hid/hid-mcp2221.c:1291
__hid_device_probe drivers/hid/hid-core.c:2775 [inline]
hid_device_probe+0x50e/0x800 drivers/hid/hid-core.c:2812
call_driver_probe drivers/base/dd.c:583 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:661
__driver_probe_device+0x1de/0x400 drivers/base/dd.c:803
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:833
__device_attach_driver+0x1df/0x340 drivers/base/dd.c:961
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1033
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1088
bus_probe_device+0x64/0x160 drivers/base/bus.c:574
device_add+0x11d9/0x1950 drivers/base/core.c:3689
hid_add_device+0x2bf/0x440 drivers/hid/hid-core.c:2951
usbhid_probe+0xd57/0x1350 drivers/hid/usbhid/hid-core.c:1450
usb_probe_interface+0x303/0x8f0 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:583 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:661
__driver_probe_device+0x1de/0x400 drivers/base/dd.c:803
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:833
__device_attach_driver+0x1df/0x340 drivers/base/dd.c:961
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1033
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1088
bus_probe_device+0x64/0x160 drivers/base/bus.c:574
device_add+0x11d9/0x1950 drivers/base/core.c:3689
usb_set_configuration+0xd97/0x1c60 drivers/usb/core/message.c:2268
usb_generic_driver_probe+0xa1/0xe0 drivers/usb/core/generic.c:250
usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:583 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:661
__driver_probe_device+0x1de/0x400 drivers/base/dd.c:803
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:833
__device_attach_driver+0x1df/0x340 drivers/base/dd.c:961
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1033
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1088
bus_probe_device+0x64/0x160 drivers/base/bus.c:574
device_add+0x11d9/0x1950 drivers/base/core.c:3689
usb_new_device.cold+0x685/0x115c drivers/usb/core/hub.c:2695
hub_port_connect drivers/usb/core/hub.c:5567 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5707 [inline]
port_event drivers/usb/core/hub.c:5871 [inline]
hub_event+0x314d/0x4af0 drivers/usb/core/hub.c:5953
process_one_work+0xa23/0x19a0 kernel/workqueue.c:3276
process_scheduled_works kernel/workqueue.c:3359 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3440
kthread+0x370/0x450 kernel/kthread.c:436
ret_from_fork+0x6c3/0xcb0 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:0x12952f
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 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 0, migratetype Unmovable, gfp_mask 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 17394, tgid 17394 (syz-executor), ts 3473270163620, free_ts 3476482503165
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x153/0x170 mm/page_alloc.c:1889
prep_new_page mm/page_alloc.c:1897 [inline]
get_page_from_freelist+0xf10/0x39f0 mm/page_alloc.c:3962
__alloc_frozen_pages_noprof+0x273/0x2860 mm/page_alloc.c:5250
alloc_pages_mpol+0xe8/0x410 mm/mempolicy.c:2484
alloc_frozen_pages_noprof mm/mempolicy.c:2555 [inline]
alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2575
pagetable_alloc_noprof include/linux/mm.h:3404 [inline]
__pte_alloc_one_noprof include/asm-generic/pgalloc.h:76 [inline]
pte_alloc_one+0x1c/0x3d0 arch/x86/mm/pgtable.c:18
__pte_alloc+0x6d/0x3e0 mm/memory.c:466
copy_pte_range mm/memory.c:1250 [inline]
copy_pmd_range mm/memory.c:1405 [inline]
copy_pud_range mm/memory.c:1442 [inline]
copy_p4d_range mm/memory.c:1466 [inline]
copy_page_range+0x1698/0x2760 mm/memory.c:1552
dup_mmap+0xcb9/0x1f30 mm/mmap.c:1841
dup_mm kernel/fork.c:1531 [inline]
copy_mm kernel/fork.c:1583 [inline]
copy_process+0x424b/0x7820 kernel/fork.c:2223
kernel_clone+0xfc/0x9a0 kernel/fork.c:2653
__do_sys_clone+0xd9/0x120 kernel/fork.c:2794
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x106/0x7b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 32567 tgid 32567 stack trace:
create_dummy_stack mm/page_owner.c:103 [inline]
register_dummy_stack+0x74/0xb0 mm/page_owner.c:109
init_page_owner+0x42/0x660 mm/page_owner.c:127
invoke_init_callbacks mm/page_ext.c:152 [inline]
page_ext_init+0x968/0x9e0 mm/page_ext.c:490
mm_core_init+0x1f8/0x250 mm/mm_init.c:2735
Memory state around the buggy address:
ffff88812952fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88812952ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88812952ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888129530000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888129530080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: f2 48 d1 fa repnz sar $1,%rdx
4: 48 8d 5c 95 00 lea 0x0(%rbp,%rdx,4),%rbx
9: 48 89 da mov %rbx,%rdx
c: 48 c1 ea 03 shr $0x3,%rdx
10: 0f b6 34 0a movzbl (%rdx,%rcx,1),%esi
14: 48 89 da mov %rbx,%rdx
17: 83 e2 07 and $0x7,%edx
1a: 83 c2 03 add $0x3,%edx
1d: 40 38 f2 cmp %sil,%dl
20: 7c 05 jl 0x27
22: 40 84 f6 test %sil,%sil
25: 75 4b jne 0x72
27: 48 63 13 movslq (%rbx),%rdx
* 2a: 48 01 da add %rbx,%rdx <-- trapping instruction
2d: 49 39 d5 cmp %rdx,%r13
30: 73 af jae 0xffffffe1
32: 4c 8d 63 fc lea -0x4(%rbx),%r12
36: 49 39 ec cmp %rbp,%r12
39: 73 b2 jae 0xffffffed
3b: 4d 29 f7 sub %r14,%r15
3e: 49 rex.WB
3f: c1 .byte 0xc1