==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff8880591c7fff by task kworker/0:6/5987
CPU: 0 UID: 0 PID: 5987 Comm: kworker/0:6 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Workqueue: usb_hub_wq hub_event
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948
__hid_input_report drivers/hid/hid-core.c:2130 [inline]
hid_input_report+0x407/0x520 drivers/hid/hid-core.c:2157
hid_irq_in+0x47e/0x6d0 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x376/0x540 drivers/usb/core/hcd.c:1661
dummy_timer+0x862/0x4550 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1777 [inline]
__hrtimer_run_queues+0x529/0xc60 kernel/time/hrtimer.c:1841
hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1858
handle_softirqs+0x283/0x870 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:lock_acquire+0x175/0x360 kernel/locking/lockdep.c:5872
Code: 00 00 00 00 9c 8f 44 24 30 f7 44 24 30 00 02 00 00 0f 85 cd 00 00 00 f7 44 24 08 00 02 00 00 74 01 fb 65 48 8b 05 eb bf ae 10 <48> 3b 44 24 58 0f 85 f2 00 00 00 48 83 c4 60 5b 41 5c 41 5d 41 5e
RSP: 0018:ffffc900047865e0 EFLAGS: 00000206
RAX: c5e71bf9c36f1000 RBX: 0000000000000000 RCX: c5e71bf9c36f1000
RDX: ffffffff92fc8f00 RSI: ffffffff8d71ebcb RDI: ffffffff8b9ec2e0
RBP: ffffffff84c0dbc4 R08: 0000000000000008 R09: ffffffff957a35e0
R10: 00000000769c5311 R11: 000000006a46b7c3 R12: 0000000000000000
R13: ffffffff8e486e28 R14: 0000000000000001 R15: 0000000000000246
__mutex_lock_common kernel/locking/mutex.c:598 [inline]
__mutex_lock+0x187/0x1350 kernel/locking/mutex.c:760
class_mutex_constructor include/linux/mutex.h:228 [inline]
gpiochip_add_data_with_key+0x594/0x13b0 drivers/gpio/gpiolib.c:1094
devm_gpiochip_add_data_with_key+0x33/0xa0 drivers/gpio/gpiolib-devres.c:356
mcp2221_probe+0x5da/0x880 drivers/hid/hid-mcp2221.c:1312
__hid_device_probe drivers/hid/hid-core.c:2740 [inline]
hid_device_probe+0x39d/0x710 drivers/hid/hid-core.c:2777
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x26d/0x9e0 drivers/base/dd.c:659
__driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801
driver_probe_device+0x4f/0x430 drivers/base/dd.c:831
__device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959
bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462
__device_attach+0x2b8/0x400 drivers/base/dd.c:1031
bus_probe_device+0x185/0x260 drivers/base/bus.c:537
device_add+0x7b6/0xb50 drivers/base/core.c:3689
hid_add_device+0x398/0x540 drivers/hid/hid-core.c:2923
usbhid_probe+0xe13/0x12a0 drivers/hid/usbhid/hid-core.c:1435
usb_probe_interface+0x668/0xc30 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x26d/0x9e0 drivers/base/dd.c:659
__driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801
driver_probe_device+0x4f/0x430 drivers/base/dd.c:831
__device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959
bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462
__device_attach+0x2b8/0x400 drivers/base/dd.c:1031
bus_probe_device+0x185/0x260 drivers/base/bus.c:537
device_add+0x7b6/0xb50 drivers/base/core.c:3689
usb_set_configuration+0x1a87/0x20e0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:250
usb_probe_device+0x1c4/0x390 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x26d/0x9e0 drivers/base/dd.c:659
__driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801
driver_probe_device+0x4f/0x430 drivers/base/dd.c:831
__device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959
bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462
__device_attach+0x2b8/0x400 drivers/base/dd.c:1031
bus_probe_device+0x185/0x260 drivers/base/bus.c:537
device_add+0x7b6/0xb50 drivers/base/core.c:3689
usb_new_device+0xa39/0x16f0 drivers/usb/core/hub.c:2694
hub_port_connect drivers/usb/core/hub.c:5566 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5706 [inline]
port_event drivers/usb/core/hub.c:5870 [inline]
hub_event+0x2958/0x4a20 drivers/usb/core/hub.c:5952
process_one_work kernel/workqueue.c:3263 [inline]
process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3346
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x436/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
The buggy address belongs to the object at ffff8880591c7c80
which belongs to the cache userfaultfd_ctx_cache of size 560
The buggy address is located 335 bytes to the right of
allocated 560-byte region [ffff8880591c7c80, ffff8880591c7eb0)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880591c4000 pfn:0x591c4
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff888145296140 dead000000000122 0000000000000000
raw: ffff8880591c4000 0000000080170016 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff888145296140 dead000000000122 0000000000000000
head: ffff8880591c4000 0000000080170016 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0001647101 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6282, tgid 6280 (syz.3.117), ts 112463776421, free_ts 112169208808
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148
alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:2492 [inline]
allocate_slab+0x8a/0x370 mm/slub.c:2660
new_slab mm/slub.c:2714 [inline]
___slab_alloc+0xbeb/0x1420 mm/slub.c:3901
__slab_alloc mm/slub.c:3992 [inline]
__slab_alloc_node mm/slub.c:4067 [inline]
slab_alloc_node mm/slub.c:4228 [inline]
kmem_cache_alloc_noprof+0x283/0x3c0 mm/slub.c:4247
new_userfaultfd+0x8b/0x390 fs/userfaultfd.c:2126
__do_sys_userfaultfd fs/userfaultfd.c:2182 [inline]
__se_sys_userfaultfd fs/userfaultfd.c:2177 [inline]
__ia32_sys_userfaultfd+0x81/0xa0 fs/userfaultfd.c:2177
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0xb6/0x2b0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x34/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
page last free pid 6270 tgid 6270 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895
stack_depot_save_flags+0x436/0x860 lib/stackdepot.c:727
kasan_save_stack mm/kasan/common.c:48 [inline]
kasan_save_track+0x4f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405
kasan_kmalloc include/linux/kasan.h:260 [inline]
__kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4407
kmalloc_noprof include/linux/slab.h:905 [inline]
tipc_topsrv_queue_evt+0xef/0x2d0 net/tipc/topsrv.c:328
tipc_sub_send_event net/tipc/subscr.c:63 [inline]
tipc_sub_report_overlap+0x4bd/0x8b0 net/tipc/subscr.c:102
tipc_nametbl_remove_publ+0xc86/0x1b60 net/tipc/name_table.c:523
tipc_nametbl_withdraw+0x8d/0x280 net/tipc/name_table.c:809
tipc_sk_withdraw net/tipc/socket.c:2936 [inline]
tipc_release+0x770/0x2190 net/tipc/socket.c:643
__sock_release net/socket.c:649 [inline]
sock_close+0xc0/0x240 net/socket.c:1442
__fput+0x44c/0xa70 fs/file_table.c:468
task_work_run+0x1d1/0x260 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xe9/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
__do_fast_syscall_32+0x1f4/0x2b0 arch/x86/entry/syscall_32.c:309
do_fast_syscall_32+0x34/0x80 arch/x86/entry/syscall_32.c:331
Memory state around the buggy address:
ffff8880591c7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880591c7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880591c7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8880591c8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8880591c8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 00 00 add %al,(%rax)
4: 9c pushf
5: 8f 44 24 30 pop 0x30(%rsp)
9: f7 44 24 30 00 02 00 testl $0x200,0x30(%rsp)
10: 00
11: 0f 85 cd 00 00 00 jne 0xe4
17: f7 44 24 08 00 02 00 testl $0x200,0x8(%rsp)
1e: 00
1f: 74 01 je 0x22
21: fb sti
22: 65 48 8b 05 eb bf ae mov %gs:0x10aebfeb(%rip),%rax # 0x10aec015
29: 10
* 2a: 48 3b 44 24 58 cmp 0x58(%rsp),%rax <-- trapping instruction
2f: 0f 85 f2 00 00 00 jne 0x127
35: 48 83 c4 60 add $0x60,%rsp
39: 5b pop %rbx
3a: 41 5c pop %r12
3c: 41 5d pop %r13
3e: 41 5e pop %r14