==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff888077ebffff by task syz.4.242/7114
CPU: 1 UID: 0 PID: 7114 Comm: syz.4.242 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
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+0x311/0x450 drivers/hid/hid-core.c:2130
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x388/0x610 drivers/usb/core/hcd.c:1661
usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745
dummy_timer+0x1814/0x3a30 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1761 [inline]
__hrtimer_run_queues+0x1ff/0xad0 kernel/time/hrtimer.c:1825
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1842
handle_softirqs+0x219/0x8e0 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0x109/0x170 kernel/softirq.c:680
irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:lock_acquire+0x62/0x350 kernel/locking/lockdep.c:5872
Code: e6 3e 12 83 f8 07 0f 87 bc 02 00 00 89 c0 48 0f a3 05 22 a2 13 0f 0f 82 74 02 00 00 8b 35 da d3 13 0f 85 f6 0f 85 8d 00 00 00 <48> 8b 44 24 30 65 48 2b 05 79 e6 3e 12 0f 85 c7 02 00 00 48 83 c4
RSP: 0018:ffffc9000ca76c70 EFLAGS: 00000206
RAX: 0000000000000046 RBX: ffffffff8e5c1260 RCX: 000000009ccb6cf7
RDX: 0000000000000000 RSI: ffffffff8de2cdc0 RDI: ffffffff8c162d80
RBP: 0000000000000002 R08: 9db3e1ba819abd31 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
rcu_read_lock include/linux/rcupdate.h:841 [inline]
class_rcu_constructor include/linux/rcupdate.h:1155 [inline]
unwind_next_frame+0xd1/0x20a0 arch/x86/kernel/unwind_orc.c:479
arch_stack_walk+0x94/0x100 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
save_stack+0x160/0x1f0 mm/page_owner.c:156
__set_page_owner+0x91/0x550 mm/page_owner.c:329
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
folio_alloc_mpol_noprof+0x36/0x2f0 mm/mempolicy.c:2435
vma_alloc_folio_noprof+0xed/0x1e0 mm/mempolicy.c:2470
folio_prealloc mm/memory.c:1061 [inline]
wp_page_copy mm/memory.c:3552 [inline]
do_wp_page+0x1136/0x4f00 mm/memory.c:4013
handle_pte_fault mm/memory.c:6068 [inline]
__handle_mm_fault+0x1b2d/0x2a50 mm/memory.c:6195
handle_mm_fault+0x589/0xd10 mm/memory.c:6364
do_user_addr_fault+0x7a6/0x1370 arch/x86/mm/fault.c:1387
handle_page_fault arch/x86/mm/fault.c:1476 [inline]
exc_page_fault+0x5c/0xb0 arch/x86/mm/fault.c:1532
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:__put_user_nocheck_4+0x3/0x10 arch/x86/lib/putuser.S:104
Code: d9 0f 01 cb 89 01 31 c9 0f 01 ca e9 47 69 03 00 0f 1f 80 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 01 cb <89> 01 31 c9 0f 01 ca c3 cc cc cc cc 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc9000ca779f8 EFLAGS: 00050293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00002000000ba030
RDX: ffff88802ff42440 RSI: ffffffff89635d93 RDI: 0000000000000005
RBP: ffffc9000ca77d98 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000000
R13: 00002000000ba000 R14: ffffc9000ca77ddc R15: 0000000000000002
____sys_recvmsg+0x2ee/0x6b0 net/socket.c:2847
___sys_recvmsg+0x114/0x1a0 net/socket.c:2876
do_recvmmsg+0x2fe/0x750 net/socket.c:2971
__sys_recvmmsg net/socket.c:3045 [inline]
__do_sys_recvmmsg net/socket.c:3068 [inline]
__se_sys_recvmmsg net/socket.c:3061 [inline]
__x64_sys_recvmmsg+0x22a/0x280 net/socket.c:3061
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f38f118eba9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f38f1fec038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007f38f13d6180 RCX: 00007f38f118eba9
RDX: 0000000000010106 RSI: 00002000000000c0 RDI: 0000000000000005
RBP: 00007f38f1211e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f38f13d6218 R14: 00007f38f13d6180 R15: 00007ffce64c9568
Allocated by task 5223:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
unpoison_slab_object mm/kasan/common.c:330 [inline]
__kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:356
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4191 [inline]
slab_alloc_node mm/slub.c:4240 [inline]
kmem_cache_alloc_lru_noprof+0x1d0/0x3b0 mm/slub.c:4259
shmem_alloc_inode+0x25/0x50 mm/shmem.c:5211
alloc_inode+0x61/0x240 fs/inode.c:346
new_inode+0x22/0x1c0 fs/inode.c:1145
__shmem_get_inode mm/shmem.c:3110 [inline]
shmem_get_inode+0x19a/0xfb0 mm/shmem.c:3184
shmem_mknod+0x1a8/0x450 mm/shmem.c:3905
lookup_open.isra.0+0x11d3/0x1580 fs/namei.c:3708
open_last_lookups fs/namei.c:3807 [inline]
path_openat+0x893/0x2cb0 fs/namei.c:4043
do_filp_open+0x20b/0x470 fs/namei.c:4073
do_sys_openat2+0x11b/0x1d0 fs/open.c:1435
do_sys_open fs/open.c:1450 [inline]
__do_sys_openat fs/open.c:1466 [inline]
__se_sys_openat fs/open.c:1461 [inline]
__x64_sys_openat+0x174/0x210 fs/open.c:1461
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888077ebf590
which belongs to the cache shmem_inode_cache of size 1544
The buggy address is located 1127 bytes to the right of
allocated 1544-byte region [ffff888077ebf590, ffff888077ebfb98)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77eb8
head: order:3 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 ffff888140408b40 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000130013 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff888140408b40 dead000000000122 0000000000000000
head: 0000000000000000 0000000000130013 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0001dfae01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5223, tgid 5223 (udevd), ts 22079345602, free_ts 22077323734
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:2492 [inline]
allocate_slab mm/slub.c:2660 [inline]
new_slab+0x247/0x330 mm/slub.c:2714
___slab_alloc+0xcf2/0x1750 mm/slub.c:3901
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992
__slab_alloc_node mm/slub.c:4067 [inline]
slab_alloc_node mm/slub.c:4228 [inline]
kmem_cache_alloc_lru_noprof+0xf4/0x3b0 mm/slub.c:4259
shmem_alloc_inode+0x25/0x50 mm/shmem.c:5211
alloc_inode+0x61/0x240 fs/inode.c:346
new_inode+0x22/0x1c0 fs/inode.c:1145
__shmem_get_inode mm/shmem.c:3110 [inline]
shmem_get_inode+0x19a/0xfb0 mm/shmem.c:3184
shmem_symlink+0xf8/0x9f0 mm/shmem.c:4158
vfs_symlink fs/namei.c:4730 [inline]
vfs_symlink+0x400/0x680 fs/namei.c:4714
do_symlinkat+0x261/0x310 fs/namei.c:4756
__do_sys_symlink fs/namei.c:4777 [inline]
__se_sys_symlink fs/namei.c:4775 [inline]
__x64_sys_symlink+0x75/0x90 fs/namei.c:4775
page last free pid 5223 tgid 5223 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895
discard_slab mm/slub.c:2758 [inline]
__put_partials+0x165/0x1c0 mm/slub.c:3223
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:340
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4191 [inline]
slab_alloc_node mm/slub.c:4240 [inline]
__kmalloc_cache_noprof+0x1f1/0x3e0 mm/slub.c:4402
kmalloc_noprof include/linux/slab.h:905 [inline]
inode_doinit_use_xattr+0x54/0x410 security/selinux/hooks.c:1366
inode_doinit_with_dentry+0x10c8/0x12e0 security/selinux/hooks.c:1560
selinux_d_instantiate+0x26/0x30 security/selinux/hooks.c:6519
security_d_instantiate+0x142/0x1a0 security/security.c:4109
d_splice_alias_ops+0x92/0x840 fs/dcache.c:2998
kernfs_iop_lookup+0x23f/0x2d0 fs/kernfs/dir.c:1251
__lookup_slow+0x251/0x460 fs/namei.c:1808
lookup_slow fs/namei.c:1825 [inline]
walk_component+0x353/0x5b0 fs/namei.c:2129
lookup_last fs/namei.c:2630 [inline]
path_lookupat+0x142/0x6d0 fs/namei.c:2654
filename_lookup+0x224/0x5f0 fs/namei.c:2683
Memory state around the buggy address:
ffff888077ebfe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888077ebff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888077ebff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888077ec0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888077ec0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: e6 3e out %al,$0x3e
2: 12 83 f8 07 0f 87 adc -0x78f0f808(%rbx),%al
8: bc 02 00 00 89 mov $0x89000002,%esp
d: c0 48 0f a3 rorb $0xa3,0xf(%rax)
11: 05 22 a2 13 0f add $0xf13a222,%eax
16: 0f 82 74 02 00 00 jb 0x290
1c: 8b 35 da d3 13 0f mov 0xf13d3da(%rip),%esi # 0xf13d3fc
22: 85 f6 test %esi,%esi
24: 0f 85 8d 00 00 00 jne 0xb7
* 2a: 48 8b 44 24 30 mov 0x30(%rsp),%rax <-- trapping instruction
2f: 65 48 2b 05 79 e6 3e sub %gs:0x123ee679(%rip),%rax # 0x123ee6b0
36: 12
37: 0f 85 c7 02 00 00 jne 0x304
3d: 48 rex.W
3e: 83 .byte 0x83
3f: c4 .byte 0xc4