==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964
Read of size 1 at addr ffff8880a424bfff by task syz.4.4543/22305
CPU: 1 UID: 0 PID: 22305 Comm: syz.4.4543 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description+0x55/0x1e0 mm/kasan/report.c:378
print_report+0x58/0x70 mm/kasan/report.c:482
kasan_report+0x117/0x150 mm/kasan/report.c:595
mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964
__hid_input_report+0x428/0x590 drivers/hid/hid-core.c:2161
hid_irq_in+0x495/0x710 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x376/0x540 drivers/usb/core/hcd.c:1655
dummy_timer+0xbc0/0x4650 drivers/usb/gadget/udc/dummy_hcd.c:2005
__run_hrtimer kernel/time/hrtimer.c:1930 [inline]
__hrtimer_run_queues+0x3c0/0xa20 kernel/time/hrtimer.c:1994
hrtimer_run_softirq+0x17a/0x240 kernel/time/hrtimer.c:2011
handle_softirqs+0x22a/0x840 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xca/0x220 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+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1061
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:lock_acquire+0x221/0x350 kernel/locking/lockdep.c:5872
Code: ff ff ff e8 31 bf 05 0a f7 44 24 08 00 02 00 00 0f 84 3a ff ff ff 65 48 8b 05 0b 9a 96 11 48 3b 44 24 58 75 33 fb 48 83 c4 60 <5b> 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc 48 8d 3d 18 e3 91
RSP: 0018:ffffc900057479a8 EFLAGS: 00000282
RAX: 3f15c861b0553000 RBX: 0000000000000000 RCX: 0000000000000046
RDX: 000000001e0a8a00 RSI: ffffffff8e216dde RDI: ffffffff8c28b8e0
RBP: ffffffff8218905f R08: ffffffff8218905f R09: ffff8880206c6538
R10: ffffc90005747aa0 R11: fffff52000ae8f5b R12: 0000000000000001
R13: ffff8880206c6538 R14: 0000000000000001 R15: 0000000000000246
__might_fault+0xcb/0x130 mm/memory.c:7340
_inline_copy_from_user include/linux/uaccess.h:169 [inline]
_copy_from_user+0x28/0xb0 lib/usercopy.c:18
copy_from_user include/linux/uaccess.h:223 [inline]
copy_msghdr_from_user net/socket.c:2628 [inline]
recvmsg_copy_msghdr net/socket.c:2884 [inline]
___sys_recvmsg+0x175/0x590 net/socket.c:2956
do_recvmmsg+0x334/0x800 net/socket.c:3055
__sys_recvmmsg net/socket.c:3129 [inline]
__do_sys_recvmmsg net/socket.c:3152 [inline]
__se_sys_recvmmsg net/socket.c:3145 [inline]
__x64_sys_recvmmsg+0x198/0x250 net/socket.c:3145
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f55bd99ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f55be859028 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007f55bdc16090 RCX: 00007f55bd99ce59
RDX: 0000000000010106 RSI: 00002000000000c0 RDI: 0000000000000004
RBP: 00007f55bda32d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f55bdc16128 R14: 00007f55bdc16090 R15: 00007f55bdd3fa48
Allocated by task 22078:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
unpoison_slab_object mm/kasan/common.c:340 [inline]
__kasan_slab_alloc+0x6c/0x80 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+0x2bc/0x650 mm/slub.c:4906
__kernfs_new_node+0xea/0x970 fs/kernfs/dir.c:664
kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:748
__kernfs_create_file+0x4b/0x2e0 fs/kernfs/file.c:1057
sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:313
create_files fs/sysfs/group.c:82 [inline]
internal_create_group+0x673/0x1190 fs/sysfs/group.c:189
internal_create_groups fs/sysfs/group.c:229 [inline]
sysfs_create_groups+0x59/0x120 fs/sysfs/group.c:255
device_add_groups drivers/base/core.c:2837 [inline]
device_add_attrs+0x1bf/0x5b0 drivers/base/core.c:2912
device_add+0x496/0xbb0 drivers/base/core.c:3645
netdev_register_kobject+0x178/0x310 net/core/net-sysfs.c:2343
register_netdevice+0x1456/0x1ec0 net/core/dev.c:11423
register_netdev+0x40/0x60 net/core/dev.c:11539
loopback_net_init+0x75/0x150 drivers/net/loopback.c:218
ops_init+0x35c/0x5c0 net/core/net_namespace.c:137
setup_net+0x118/0x340 net/core/net_namespace.c:446
copy_net_ns+0x50e/0x730 net/core/net_namespace.c:579
create_new_namespaces+0x3e7/0x6a0 kernel/nsproxy.c:132
copy_namespaces+0x438/0x4b0 kernel/nsproxy.c:195
copy_process+0x1f49/0x4440 kernel/fork.c:2267
kernel_clone+0x2d7/0x940 kernel/fork.c:2722
__do_sys_clone kernel/fork.c:2863 [inline]
__se_sys_clone kernel/fork.c:2847 [inline]
__x64_sys_clone+0x1b6/0x230 kernel/fork.c:2847
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 15:
kasan_save_stack mm/kasan/common.c:57 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2689 [inline]
slab_free mm/slub.c:6251 [inline]
kmem_cache_free+0x182/0x650 mm/slub.c:6378
rcu_do_batch kernel/rcu/tree.c:2617 [inline]
rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869
handle_softirqs+0x22a/0x840 kernel/softirq.c:622
run_ksoftirqd+0x36/0x60 kernel/softirq.c:1076
smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160
kthread+0x389/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57
kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
__call_rcu_common kernel/rcu/tree.c:3131 [inline]
call_rcu+0xee/0x890 kernel/rcu/tree.c:3251
kernfs_put+0x259/0x520 fs/kernfs/dir.c:618
kernfs_remove_by_name_ns+0xc8/0x140 fs/kernfs/dir.c:1799
kernfs_remove_by_name include/linux/kernfs.h:639 [inline]
remove_files fs/sysfs/group.c:28 [inline]
sysfs_remove_group+0xfc/0x2e0 fs/sysfs/group.c:328
sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:352
device_remove_groups drivers/base/core.c:2844 [inline]
device_remove_attrs+0x1cb/0x280 drivers/base/core.c:2974
device_del+0x51f/0x8f0 drivers/base/core.c:3894
unregister_netdevice_many_notify+0x1d5f/0x22c0 net/core/dev.c:12456
unregister_netdevice_many net/core/dev.c:12484 [inline]
default_device_exit_batch+0x962/0x9e0 net/core/dev.c:13076
ops_exit_list net/core/net_namespace.c:205 [inline]
ops_undo_list+0x52b/0x940 net/core/net_namespace.c:252
cleanup_net+0x56b/0x800 net/core/net_namespace.c:702
process_one_work kernel/workqueue.c:3314 [inline]
process_scheduled_works+0xb5d/0x1860 kernel/workqueue.c:3397
worker_thread+0xa53/0xfc0 kernel/workqueue.c:3478
kthread+0x389/0x470 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 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 object at ffff8880a424bf00
which belongs to the cache kernfs_node_cache of size 176
The buggy address is located 79 bytes to the right of
allocated 176-byte region [ffff8880a424bf00, ffff8880a424bfb0)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xa424b
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88801c2be000 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800110011 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 20412, tgid 20412 (syz-executor), ts 1043034883249, free_ts 1042847714546
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x22d/0x280 mm/page_alloc.c:1853
prep_new_page mm/page_alloc.c:1861 [inline]
get_page_from_freelist+0x2593/0x2610 mm/page_alloc.c:3941
__alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5221
alloc_slab_page mm/slub.c:3278 [inline]
allocate_slab+0x77/0x660 mm/slub.c:3467
new_slab mm/slub.c:3525 [inline]
refill_objects+0x339/0x3d0 mm/slub.c:7272
refill_sheaf mm/slub.c:2816 [inline]
__pcs_replace_empty_main+0x321/0x720 mm/slub.c:4652
alloc_from_pcs mm/slub.c:4750 [inline]
slab_alloc_node mm/slub.c:4884 [inline]
kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4906
__kernfs_new_node+0xea/0x970 fs/kernfs/dir.c:664
kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:748
__kernfs_create_file+0x4b/0x2e0 fs/kernfs/file.c:1057
sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:313
create_files fs/sysfs/group.c:82 [inline]
internal_create_group+0x673/0x1190 fs/sysfs/group.c:189
internal_create_groups fs/sysfs/group.c:229 [inline]
sysfs_create_groups+0x59/0x120 fs/sysfs/group.c:255
device_add_groups drivers/base/core.c:2837 [inline]
device_add_attrs+0xdd/0x5b0 drivers/base/core.c:2901
device_add+0x496/0xbb0 drivers/base/core.c:3645
netdev_register_kobject+0x178/0x310 net/core/net-sysfs.c:2343
page last free pid 20480 tgid 20480 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1397 [inline]
__free_frozen_pages+0xc1c/0xd30 mm/page_alloc.c:2938
vfree+0x1d1/0x2f0 mm/vmalloc.c:3472
kvm_arch_free_memslot+0x13e/0x170 arch/x86/kvm/x86.c:13556
kvm_free_memslot virt/kvm/kvm_main.c:942 [inline]
kvm_free_memslots+0x15b/0x200 virt/kvm/kvm_main.c:963
kvm_destroy_vm virt/kvm/kvm_main.c:1298 [inline]
kvm_put_kvm+0x8b2/0xa50 virt/kvm/kvm_main.c:1331
kvm_vm_release+0x43/0x50 virt/kvm/kvm_main.c:1354
__fput+0x44f/0xa60 fs/file_table.c:510
task_work_run+0x1d9/0x270 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
exit_to_user_mode_loop+0x193/0x680 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
do_syscall_64+0x353/0x580 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff8880a424be80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff8880a424bf00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880a424bf80: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc
^
ffff8880a424c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8880a424c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess), 2 bytes skipped:
0: ff ljmp (bad)
1: e8 31 bf 05 0a call 0xa05bf37
6: f7 44 24 08 00 02 00 testl $0x200,0x8(%rsp)
d: 00
e: 0f 84 3a ff ff ff je 0xffffff4e
14: 65 48 8b 05 0b 9a 96 mov %gs:0x11969a0b(%rip),%rax # 0x11969a27
1b: 11
1c: 48 3b 44 24 58 cmp 0x58(%rsp),%rax
21: 75 33 jne 0x56
23: fb sti
24: 48 83 c4 60 add $0x60,%rsp
* 28: 5b pop %rbx <-- trapping instruction
29: 41 5c pop %r12
2b: 41 5d pop %r13
2d: 41 5e pop %r14
2f: 41 5f pop %r15
31: 5d pop %rbp
32: c3 ret
33: cc int3
34: cc int3
35: cc int3
36: cc int3
37: cc int3
38: 48 rex.W
39: 8d .byte 0x8d
3a: 3d .byte 0x3d
3b: 18 e3 sbb %ah,%bl
3d: 91 xchg %eax,%ecx