==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x1062/0x1240 drivers/hid/hid-mcp2221.c:858
Read of size 1 at addr ffff888077947fff by task syz.4.963/10816
CPU: 1 PID: 10816 Comm: syz.4.963 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
mcp2221_raw_event+0x1062/0x1240 drivers/hid/hid-mcp2221.c:858
hid_input_report+0x3ed/0x500 drivers/hid/hid-core.c:2132
hid_irq_in+0x478/0x6d0 drivers/hid/usbhid/hid-core.c:284
__usb_hcd_giveback_urb+0x35d/0x520 drivers/usb/core/hcd.c:1648
dummy_timer+0xa58/0x34e0 drivers/usb/gadget/udc/dummy_hcd.c:2017
__run_hrtimer kernel/time/hrtimer.c:1754 [inline]
__hrtimer_run_queues+0x525/0xc10 kernel/time/hrtimer.c:1818
hrtimer_run_softirq+0x177/0x290 kernel/time/hrtimer.c:1835
handle_softirqs+0x27d/0x820 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0xd3/0x190 kernel/softirq.c:661
irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
RIP: 0010:check_kcov_mode kernel/kcov.c:178 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x17/0x60 kernel/kcov.c:212
Code: 48 8b 3d fc 16 05 0d 48 89 de 5b e9 13 ad 57 00 cc cc cc f3 0f 1e fa 48 8b 04 24 65 48 8b 0d 80 45 7c 7e 65 8b 15 81 45 7c 7e <81> e2 00 01 ff 00 74 11 81 fa 00 01 00 00 75 35 83 b9 24 16 00 00
RSP: 0018:ffffc9000bb67610 EFLAGS: 00000202
RAX: ffffffff813baa4c RBX: ffffffff8f0f8ad6 RCX: ffff888027153c00
RDX: 0000000080000001 RSI: ffffffff8cfa05a0 RDI: 0000000000000002
RBP: ffffc9000bb67798 R08: ffff888027153c00 R09: 0000000000000002
R10: 0000000000000001 R11: 0000000000000002 R12: ffffffff8f0f8adb
R13: ffffc9000bb67748 R14: 0000000000000002 R15: dffffc0000000000
unwind_next_frame+0x67c/0x2990 arch/x86/kernel/unwind_orc.c:505
__unwind_start+0x5bb/0x730 arch/x86/kernel/unwind_orc.c:760
unwind_start arch/x86/include/asm/unwind.h:64 [inline]
arch_stack_walk+0xf8/0x190 arch/x86/kernel/stacktrace.c:24
stack_trace_save+0xaa/0x100 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1811 [inline]
slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
slab_free mm/slub.c:3830 [inline]
__kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1109 [inline]
raw_ioctl+0x24d4/0x3d80 drivers/usb/gadget/legacy/raw_gadget.c:1280
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f5316b9ddeb
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:00007f5314df4f60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f5316b9ddeb
RDX: 00007f5314df4fe0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007f5316f50320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 0000200000000080
R13: 0000000000000000 R14: 00007f5316e25fa0 R15: 00007ffdcce98d98
Allocated by task 5142:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
__kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook+0x6a/0x4d0 mm/slab.h:770
slab_alloc_node mm/slub.c:3495 [inline]
slab_alloc mm/slub.c:3503 [inline]
__kmem_cache_alloc_lru mm/slub.c:3510 [inline]
kmem_cache_alloc+0x17e/0x2c0 mm/slub.c:3519
getname_flags+0xbb/0x500 fs/namei.c:140
do_sys_openat2+0xda/0x1d0 fs/open.c:1416
do_sys_open fs/open.c:1437 [inline]
__do_sys_openat fs/open.c:1453 [inline]
__se_sys_openat fs/open.c:1448 [inline]
__x64_sys_openat+0x139/0x160 fs/open.c:1448
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
Freed by task 5142:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1811 [inline]
slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
slab_free mm/slub.c:3830 [inline]
kmem_cache_free+0xf8/0x290 mm/slub.c:3852
do_sys_openat2+0x170/0x1d0 fs/open.c:1430
do_sys_open fs/open.c:1437 [inline]
__do_sys_openat fs/open.c:1453 [inline]
__se_sys_openat fs/open.c:1448 [inline]
__x64_sys_openat+0x139/0x160 fs/open.c:1448
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
The buggy address belongs to the object at ffff888077946600
which belongs to the cache names_cache of size 4096
The buggy address is located 2559 bytes to the right of
allocated 4096-byte region [ffff888077946600, ffff888077947600)
The buggy address belongs to the physical page:
page:ffffea0001de5000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77940
head:ffffea0001de5000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888019e5c780 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5142, tgid 5142 (udevd), ts 663738622251, free_ts 650272874729
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
prep_new_page mm/page_alloc.c:1589 [inline]
get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
__alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
alloc_slab_page+0x5d/0x180 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2d0 mm/slub.c:2081
___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
slab_alloc mm/slub.c:3503 [inline]
__kmem_cache_alloc_lru mm/slub.c:3510 [inline]
kmem_cache_alloc+0x109/0x2c0 mm/slub.c:3519
getname_flags+0xbb/0x500 fs/namei.c:140
user_path_at_empty+0x2c/0x60 fs/namei.c:2959
do_readlinkat+0xdd/0x490 fs/stat.c:494
__do_sys_readlink fs/stat.c:527 [inline]
__se_sys_readlink fs/stat.c:524 [inline]
__x64_sys_readlink+0x7f/0x90 fs/stat.c:524
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1182 [inline]
free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459
__slab_free+0x35a/0x400 mm/slub.c:3736
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x75/0xd0 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:306
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook+0x6a/0x4d0 mm/slab.h:770
slab_alloc_node mm/slub.c:3495 [inline]
__kmem_cache_alloc_node+0x194/0x250 mm/slub.c:3534
kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
nf_nat_masq_schedule+0x23e/0x570 net/netfilter/nf_nat_masquerade.c:118
masq_device_event+0xa2/0xd0 net/netfilter/nf_nat_masquerade.c:162
notifier_call_chain+0x18f/0x380 kernel/notifier.c:93
call_netdevice_notifiers_extack net/core/dev.c:2077 [inline]
call_netdevice_notifiers net/core/dev.c:2091 [inline]
__dev_notify_flags+0x16f/0x310 net/core/dev.c:8782
dev_change_flags+0xde/0x1a0 net/core/dev.c:8818
do_setlink+0xb69/0x3f40 net/core/rtnetlink.c:2917
rtnl_group_changelink net/core/rtnetlink.c:3466 [inline]
__rtnl_newlink net/core/rtnetlink.c:3725 [inline]
rtnl_newlink+0x1145/0x2170 net/core/rtnetlink.c:3762
Memory state around the buggy address:
ffff888077947e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888077947f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888077947f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888077948000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888077948080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 48 8b 3d fc 16 05 0d mov 0xd0516fc(%rip),%rdi # 0xd051703
7: 48 89 de mov %rbx,%rsi
a: 5b pop %rbx
b: e9 13 ad 57 00 jmp 0x57ad23
10: cc int3
11: cc int3
12: cc int3
13: f3 0f 1e fa endbr64
17: 48 8b 04 24 mov (%rsp),%rax
1b: 65 48 8b 0d 80 45 7c mov %gs:0x7e7c4580(%rip),%rcx # 0x7e7c45a3
22: 7e
23: 65 8b 15 81 45 7c 7e mov %gs:0x7e7c4581(%rip),%edx # 0x7e7c45ab
* 2a: 81 e2 00 01 ff 00 and $0xff0100,%edx <-- trapping instruction
30: 74 11 je 0x43
32: 81 fa 00 01 00 00 cmp $0x100,%edx
38: 75 35 jne 0x6f
3a: 83 .byte 0x83
3b: b9 24 16 00 00 mov $0x1624,%ecx