==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88813fd1ffff by task kworker/1:5/13731
CPU: 1 UID: 0 PID: 13731 Comm: kworker/1:5 Not tainted syzkaller #0 PREEMPT(voluntary)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: usb_hub_wq hub_event
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xcd/0x630 mm/kasan/report.c:482
kasan_report+0xe0/0x110 mm/kasan/report.c:595
mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948
__hid_input_report.constprop.0+0x314/0x470 drivers/hid/hid-core.c:2139
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38b/0x610 drivers/usb/core/hcd.c:1661
usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745
dummy_timer+0x1809/0x3ad0 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1777 [inline]
__hrtimer_run_queues+0x202/0xc40 kernel/time/hrtimer.c:1841
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858
handle_softirqs+0x208/0x940 kernel/softirq.c:622
do_softirq kernel/softirq.c:523 [inline]
do_softirq+0xb2/0xf0 kernel/softirq.c:510
__local_bh_enable_ip+0x100/0x120 kernel/softirq.c:450
local_bh_enable include/linux/bottom_half.h:33 [inline]
__alloc_skb+0x381/0x410 net/core/skbuff.c:674
alloc_skb include/linux/skbuff.h:1383 [inline]
alloc_uevent_skb+0x7d/0x210 lib/kobject_uevent.c:289
uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline]
kobject_uevent_net_broadcast lib/kobject_uevent.c:410 [inline]
kobject_uevent_env+0xd05/0x1920 lib/kobject_uevent.c:608
device_add+0x1103/0x1980 drivers/base/core.c:3670
i2c_register_adapter+0x39e/0x13b0 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+0x5f1/0xc50 drivers/hid/hid-mcp2221.c:1289
__hid_device_probe drivers/hid/hid-core.c:2775 [inline]
hid_device_probe+0x5ba/0x8d0 drivers/hid/hid-core.c:2812
call_driver_probe drivers/base/dd.c:581 [inline]
really_probe+0x241/0xb20 drivers/base/dd.c:659
__driver_probe_device+0x1de/0x470 drivers/base/dd.c:801
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831
__device_attach_driver+0x1df/0x350 drivers/base/dd.c:959
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4e0 drivers/base/dd.c:1031
device_initial_probe+0xaa/0xc0 drivers/base/dd.c:1086
bus_probe_device+0x64/0x150 drivers/base/bus.c:574
device_add+0x116e/0x1980 drivers/base/core.c:3689
hid_add_device+0x31b/0x5c0 drivers/hid/hid-core.c:2951
usbhid_probe+0xd5d/0x1410 drivers/hid/usbhid/hid-core.c:1435
usb_probe_interface+0x303/0xa80 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:581 [inline]
really_probe+0x241/0xb20 drivers/base/dd.c:659
__driver_probe_device+0x1de/0x470 drivers/base/dd.c:801
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831
__device_attach_driver+0x1df/0x350 drivers/base/dd.c:959
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4e0 drivers/base/dd.c:1031
device_initial_probe+0xaa/0xc0 drivers/base/dd.c:1086
bus_probe_device+0x64/0x150 drivers/base/bus.c:574
device_add+0x116e/0x1980 drivers/base/core.c:3689
usb_set_configuration+0x1187/0x1e50 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250
usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:581 [inline]
really_probe+0x241/0xb20 drivers/base/dd.c:659
__driver_probe_device+0x1de/0x470 drivers/base/dd.c:801
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831
__device_attach_driver+0x1df/0x350 drivers/base/dd.c:959
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4e0 drivers/base/dd.c:1031
device_initial_probe+0xaa/0xc0 drivers/base/dd.c:1086
bus_probe_device+0x64/0x150 drivers/base/bus.c:574
device_add+0x116e/0x1980 drivers/base/core.c:3689
usb_new_device+0xd07/0x1a90 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+0x31bf/0x5420 drivers/usb/core/hub.c:5953
process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421
kthread+0x3c5/0x780 kernel/kthread.c:463
ret_from_fork+0x74f/0xa30 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88813fd1f780 pfn:0x13fd1f
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000
raw: ffff88813fd1f780 00000000000c0000 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 19064, tgid 19064 (modprobe), ts 1495793894501, free_ts 1545386719100
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846
prep_new_page mm/page_alloc.c:1854 [inline]
get_page_from_freelist+0x1058/0x3cb0 mm/page_alloc.c:3915
__alloc_frozen_pages_noprof+0x259/0x21c0 mm/page_alloc.c:5210
alloc_pages_mpol+0xe4/0x410 mm/mempolicy.c:2486
alloc_slab_page mm/slub.c:3075 [inline]
allocate_slab mm/slub.c:3248 [inline]
new_slab+0x2c3/0x430 mm/slub.c:3302
___slab_alloc+0xe20/0x1ca0 mm/slub.c:4656
__kmem_cache_alloc_bulk+0x1fb/0x6c0 mm/slub.c:7429
refill_sheaf mm/slub.c:2650 [inline]
alloc_full_sheaf mm/slub.c:2671 [inline]
__pcs_replace_empty_main+0x2b2/0x4e0 mm/slub.c:5033
alloc_from_pcs mm/slub.c:5121 [inline]
slab_alloc_node mm/slub.c:5248 [inline]
kmem_cache_alloc_noprof+0x58d/0x740 mm/slub.c:5270
vm_area_alloc+0x1f/0x160 mm/vma_init.c:32
__mmap_new_vma mm/vma.c:2469 [inline]
__mmap_region+0xf94/0x2750 mm/vma.c:2708
mmap_region+0x1ab/0x3f0 mm/vma.c:2786
do_mmap+0xa2e/0x11f0 mm/mmap.c:558
vm_mmap_pgoff+0x201/0x390 mm/util.c:581
ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:604
__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
page last free pid 20084 tgid 20083 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0x795/0x1010 mm/page_alloc.c:2943
rcu_do_batch kernel/rcu/tree.c:2605 [inline]
rcu_core+0x79c/0x15f0 kernel/rcu/tree.c:2857
handle_softirqs+0x208/0x940 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xfa/0x160 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+0x90/0xb0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
Memory state around the buggy address:
ffff88813fd1fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88813fd1ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88813fd1ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88813fd20000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88813fd20080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================