==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x101c/0x1090 drivers/hid/hid-mcp2221.c:964
Read of size 1 at addr ffff88812fef7fff by task kworker/0:9/10924
CPU: 0 UID: 0 PID: 10924 Comm: kworker/0:9 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/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+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:on_stack arch/x86/include/asm/stacktrace.h:60 [inline]
RIP: 0010:unwind_next_frame+0x16dd/0x2090 arch/x86/kernel/unwind_orc.c:694
Code: fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 94 07 00 00 49 8b 45 10 48 39 dd 0f 87 f5 f8 ff ff 48 39 d8 0f 86 ec f8 ff ff <48> 8d 53 08 48 39 d5 0f 92 c1 48 39 d0 0f 93 c0 84 c1 0f 84 d4 f8
RSP: 0000:ffffc9001329e3d8 EFLAGS: 00000212
RAX: ffffc900132a0000 RBX: ffffc9001329f9f8 RCX: ffffffff8b4f769c
RDX: 1ffff92002653c8b RSI: ffffc9001329f9c8 RDI: ffffc9001329e458
RBP: ffffc90013298000 R08: 0000000000000001 R09: 0000000000000007
R10: 0000000000000200 R11: 0000000000003ab9 R12: ffffc9001329e498
R13: ffffc9001329e448 R14: ffffc9001329f9f8 R15: ffffc9001329e47c
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
unpoison_slab_object mm/kasan/common.c:340 [inline]
__kasan_slab_alloc+0x6e/0x70 mm/kasan/common.c:366
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4570 [inline]
slab_alloc_node mm/slub.c:4899 [inline]
kmem_cache_alloc_noprof+0x2e7/0x6a0 mm/slub.c:4906
skb_clone+0x190/0x400 net/core/skbuff.c:2107
do_one_broadcast net/netlink/af_netlink.c:1455 [inline]
netlink_broadcast_filtered+0xb22/0xf20 net/netlink/af_netlink.c:1538
netlink_broadcast+0x39/0x50 net/netlink/af_netlink.c:1562
uevent_net_broadcast_untagged lib/kobject_uevent.c:331 [inline]
kobject_uevent_net_broadcast lib/kobject_uevent.c:410 [inline]
kobject_uevent_env+0xcdd/0x18b0 lib/kobject_uevent.c:611
device_add+0x116e/0x1950 drivers/base/core.c:3672
i2c_register_adapter+0x39e/0x1210 drivers/i2c/i2c-core-base.c:1572
i2c_add_adapter drivers/i2c/i2c-core-base.c:1672 [inline]
i2c_add_adapter+0x10a/0x1a0 drivers/i2c/i2c-core-base.c:1652
devm_i2c_add_adapter+0x1b/0x90 drivers/i2c/i2c-core-base.c:1844
mcp2221_probe.cold+0x60e/0xf16 drivers/hid/hid-mcp2221.c:1306
__hid_device_probe drivers/hid/hid-core.c:2822 [inline]
hid_device_probe+0x50e/0x800 drivers/hid/hid-core.c:2859
call_driver_probe drivers/base/dd.c:631 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:709
__driver_probe_device+0x22e/0x480 drivers/base/dd.c:871
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:901
__device_attach_driver+0x1df/0x340 drivers/base/dd.c:1029
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1101
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1156
bus_probe_device+0x64/0x160 drivers/base/bus.c:613
device_add+0x1210/0x1950 drivers/base/core.c:3706
hid_add_device+0x2bf/0x440 drivers/hid/hid-core.c:3003
usbhid_probe+0xc3c/0x1230 drivers/hid/usbhid/hid-core.c:1449
usb_probe_interface+0x303/0x8f0 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:631 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:709
__driver_probe_device+0x22e/0x480 drivers/base/dd.c:871
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:901
__device_attach_driver+0x1df/0x340 drivers/base/dd.c:1029
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1101
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1156
bus_probe_device+0x64/0x160 drivers/base/bus.c:613
device_add+0x1210/0x1950 drivers/base/core.c:3706
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:631 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:709
__driver_probe_device+0x22e/0x480 drivers/base/dd.c:871
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:901
__device_attach_driver+0x1df/0x340 drivers/base/dd.c:1029
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1101
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1156
bus_probe_device+0x64/0x160 drivers/base/bus.c:613
device_add+0x1210/0x1950 drivers/base/core.c:3706
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+0xa0e/0x1980 kernel/workqueue.c:3314
process_scheduled_works kernel/workqueue.c:3397 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3478
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:0xffff88812fef7c60 pfn:0x12fef7
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000
raw: ffff88812fef7c60 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 2969, tgid 2969 (syz-executor), ts 756974295162, free_ts 760878594799
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_pages_mpol+0xe8/0x410 mm/mempolicy.c:2490
alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2581
pagetable_alloc_noprof include/linux/mm.h:3651 [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/0x380 mm/memory.c:453
copy_pte_range mm/memory.c:1253 [inline]
copy_pmd_range mm/memory.c:1408 [inline]
copy_pud_range mm/memory.c:1445 [inline]
copy_p4d_range mm/memory.c:1469 [inline]
copy_page_range+0x2d19/0x56a0 mm/memory.c:1555
dup_mmap+0xcd8/0x1f60 mm/mmap.c:1840
dup_mm kernel/fork.c:1534 [inline]
copy_mm kernel/fork.c:1586 [inline]
copy_process+0x4928/0x7c70 kernel/fork.c:2264
kernel_clone+0x176/0x9e0 kernel/fork.c:2722
__do_sys_clone+0xd9/0x120 kernel/fork.c:2863
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 14 tgid 14 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
__pagetable_free include/linux/mm.h:3661 [inline]
pagetable_free include/linux/mm.h:3685 [inline]
pagetable_dtor_free include/linux/mm.h:3784 [inline]
__tlb_remove_table include/asm-generic/tlb.h:221 [inline]
__tlb_remove_table_free mm/mmu_gather.c:228 [inline]
tlb_remove_table_rcu+0x2cf/0x380 mm/mmu_gather.c:291
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:
ffff88812fef7e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88812fef7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88812fef7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88812fef8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88812fef8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: fc cld
1: ff lcall (bad)
2: df 48 89 fisttps -0x77(%rax)
5: fa cli
6: 48 c1 ea 03 shr $0x3,%rdx
a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
e: 0f 85 94 07 00 00 jne 0x7a8
14: 49 8b 45 10 mov 0x10(%r13),%rax
18: 48 39 dd cmp %rbx,%rbp
1b: 0f 87 f5 f8 ff ff ja 0xfffff916
21: 48 39 d8 cmp %rbx,%rax
24: 0f 86 ec f8 ff ff jbe 0xfffff916
* 2a: 48 8d 53 08 lea 0x8(%rbx),%rdx <-- trapping instruction
2e: 48 39 d5 cmp %rdx,%rbp
31: 0f 92 c1 setb %cl
34: 48 39 d0 cmp %rdx,%rax
37: 0f 93 c0 setae %al
3a: 84 c1 test %al,%cl
3c: 0f .byte 0xf
3d: 84 d4 test %dl,%ah
3f: f8 clc