==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88802fe17fff by task syz.2.170/6365
CPU: 0 UID: 0 PID: 6365 Comm: syz.2.170 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
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:2139 [inline]
hid_input_report+0x41d/0x580 drivers/hid/hid-core.c:2166
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+0x85f/0x45b0 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1777 [inline]
__hrtimer_run_queues+0x52c/0xc60 kernel/time/hrtimer.c:1841
hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1858
handle_softirqs+0x286/0x870 kernel/softirq.c:626
__do_softirq kernel/softirq.c:660 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:727
irq_exit_rcu+0x9/0x30 kernel/softirq.c:743
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:697
RIP: 0010:check_preemption_disabled+0x49/0x120 lib/smp_processor_id.c:53
Code: 8b 0d 0b 02 1d 07 f7 c1 ff ff ff 7f 74 23 65 48 8b 0d eb 01 1d 07 48 3b 4c 24 08 0f 85 cc 00 00 00 48 83 c4 10 5b 41 5e 41 5f <5d> e9 91 cf 02 00 cc 48 c7 04 24 00 00 00 00 9c 8f 04 24 f7 04 24
RSP: 0018:ffffc9000400f648 EFLAGS: 00000286
RAX: 0000000000000000 RBX: ffffffff8b57115a RCX: 53b2867aaeef3800
RDX: 0000000000000001 RSI: ffffffff8bbf3240 RDI: ffffffff8bbf3200
RBP: dffffc0000000000 R08: 0000000000000000 R09: ffffffff8173dfc5
R10: ffffc9000400f798 R11: ffffffff81ad2830 R12: 1ffff92000801ee9
R13: ffffc9000400f780 R14: ffffc9000400f748 R15: ffffffff8173dfc5
rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline]
rcu_is_watching+0x15/0xb0 kernel/rcu/tree.c:751
rcu_read_lock include/linux/rcupdate.h:868 [inline]
class_rcu_constructor include/linux/rcupdate.h:1195 [inline]
unwind_next_frame+0xd4/0x2390 arch/x86/kernel/unwind_orc.c:479
arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:56 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:252 [inline]
__kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284
kasan_slab_free include/linux/kasan.h:234 [inline]
slab_free_hook mm/slub.c:2547 [inline]
slab_free mm/slub.c:6642 [inline]
kfree+0x19a/0x6d0 mm/slub.c:6849
raw_ioctl+0x1fca/0x4050 drivers/usb/gadget/legacy/raw_gadget.c:-1
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f092738f2cb
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007f0928180f70 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f092738f2cb
RDX: 00007f0928180ff0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007f0927710320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 00002000000004c0
R13: 0000000000000000 R14: 00007f09275e5fa0 R15: 00007fffa0da8e18
Allocated by task 5824:
kasan_save_stack mm/kasan/common.c:56 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
poison_kmalloc_redzone mm/kasan/common.c:397 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:414
kasan_kmalloc include/linux/kasan.h:262 [inline]
__do_kmalloc_node mm/slub.c:5654 [inline]
__kmalloc_node_track_caller_noprof+0x571/0x810 mm/slub.c:5763
kmemdup_noprof+0x2b/0x70 mm/util.c:138
kmemdup_noprof include/linux/fortify-string.h:765 [inline]
cache_create_net+0x2f/0x260 net/sunrpc/cache.c:1743
nfsd_export_init+0x59/0x1f0 fs/nfsd/export.c:1492
nfsd_net_init+0x2f/0x480 fs/nfsd/nfsctl.c:2148
ops_init+0x35c/0x5c0 net/core/net_namespace.c:137
setup_net+0x110/0x330 net/core/net_namespace.c:446
copy_net_ns+0x34e/0x560 net/core/net_namespace.c:581
create_new_namespaces+0x3d3/0x710 kernel/nsproxy.c:111
unshare_nsproxy_namespaces+0x11c/0x170 kernel/nsproxy.c:222
ksys_unshare+0x4c8/0x8c0 kernel/fork.c:3129
__do_sys_unshare kernel/fork.c:3200 [inline]
__se_sys_unshare kernel/fork.c:3198 [inline]
__x64_sys_unshare+0x38/0x50 kernel/fork.c:3198
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802fe17c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 743 bytes to the right of
allocated 280-byte region [ffff88802fe17c00, ffff88802fe17d18)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2fe14
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 ffff88813ff26c80 ffffea00014e6a00 dead000000000002
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88813ff26c80 ffffea00014e6a00 dead000000000002
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0000bf8501 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 5198, tgid 5198 (udevadm), ts 29045089304, free_ts 28902418132
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+0x2365/0x2440 mm/page_alloc.c:3920
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5214
alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2479
alloc_slab_page mm/slub.c:3063 [inline]
allocate_slab+0x96/0x350 mm/slub.c:3236
new_slab mm/slub.c:3290 [inline]
___slab_alloc+0xf56/0x1990 mm/slub.c:4659
__slab_alloc+0x65/0x100 mm/slub.c:4782
__slab_alloc_node mm/slub.c:4858 [inline]
slab_alloc_node mm/slub.c:5280 [inline]
__kmalloc_cache_noprof+0x41e/0x700 mm/slub.c:5770
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
kernfs_fop_open+0x397/0xca0 fs/kernfs/file.c:641
do_dentry_open+0x953/0x13f0 fs/open.c:965
vfs_open+0x3b/0x340 fs/open.c:1097
do_open fs/namei.c:3975 [inline]
path_openat+0x2ee5/0x3830 fs/namei.c:4134
do_filp_open+0x1fa/0x410 fs/namei.c:4161
do_sys_openat2+0x121/0x1c0 fs/open.c:1437
do_sys_open fs/open.c:1452 [inline]
__do_sys_openat fs/open.c:1468 [inline]
__se_sys_openat fs/open.c:1463 [inline]
__x64_sys_openat+0x138/0x170 fs/open.c:1463
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
page last free pid 5200 tgid 5200 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0xbc8/0xd30 mm/page_alloc.c:2948
discard_slab mm/slub.c:3334 [inline]
__put_partials+0x146/0x170 mm/slub.c:3880
put_cpu_partial+0x1f2/0x2e0 mm/slub.c:3955
__slab_free+0x2b9/0x390 mm/slub.c:5933
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:349
kasan_slab_alloc include/linux/kasan.h:252 [inline]
slab_post_alloc_hook mm/slub.c:4982 [inline]
slab_alloc_node mm/slub.c:5292 [inline]
kmem_cache_alloc_noprof+0x37d/0x700 mm/slub.c:5299
getname_flags+0xb8/0x540 fs/namei.c:146
getname include/linux/fs.h:3006 [inline]
do_sys_openat2+0xbc/0x1c0 fs/open.c:1431
do_sys_open fs/open.c:1452 [inline]
__do_sys_openat fs/open.c:1468 [inline]
__se_sys_openat fs/open.c:1463 [inline]
__x64_sys_openat+0x138/0x170 fs/open.c:1463
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802fe17e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802fe17f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88802fe17f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802fe18000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802fe18080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 8b 0d 0b 02 1d 07 mov 0x71d020b(%rip),%ecx # 0x71d0211
6: f7 c1 ff ff ff 7f test $0x7fffffff,%ecx
c: 74 23 je 0x31
e: 65 48 8b 0d eb 01 1d mov %gs:0x71d01eb(%rip),%rcx # 0x71d0201
15: 07
16: 48 3b 4c 24 08 cmp 0x8(%rsp),%rcx
1b: 0f 85 cc 00 00 00 jne 0xed
21: 48 83 c4 10 add $0x10,%rsp
25: 5b pop %rbx
26: 41 5e pop %r14
28: 41 5f pop %r15
* 2a: 5d pop %rbp <-- trapping instruction
2b: e9 91 cf 02 00 jmp 0x2cfc1
30: cc int3
31: 48 c7 04 24 00 00 00 movq $0x0,(%rsp)
38: 00
39: 9c pushf
3a: 8f 04 24 pop (%rsp)
3d: f7 .byte 0xf7
3e: 04 24 add $0x24,%al