==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975
Read of size 1 at addr ffff888114213fff by task syz.3.2627/17471
CPU: 0 UID: 0 PID: 17471 Comm: syz.3.2627 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975
__hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2175
hid_irq_in+0x55d/0x710 drivers/hid/usbhid/hid-core.c:287
__usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xdaf/0x3820 drivers/usb/gadget/udc/dummy_hcd.c:2023
__run_hrtimer kernel/time/hrtimer.c:2074 [inline]
__hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2131
hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2148
handle_softirqs+0x1d9/0x9b0 kernel/softirq.c:645
__do_softirq kernel/softirq.c:679 [inline]
invoke_softirq kernel/softirq.c:519 [inline]
__irq_exit_rcu+0x168/0x210 kernel/softirq.c:758
irq_exit_rcu+0x9/0x30 kernel/softirq.c:775
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:221
Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 b6 67 04 fa 48 89 df e8 3e be 04 fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 75 02 f7 f9 65 48 83 3d b4 0e 98 05 00 74 16 5b
RSP: 0018:ffffc9000296fc08 EFLAGS: 00000246
RAX: 0000000000000002 RBX: ffff88810a748000 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff892df1e1 RDI: ffffffff87d2bd80
RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff88810a748c00
R13: ffff88810a748bfc R14: 0000000000000004 R15: ffff888135b9dc6c
spin_unlock_irqrestore include/linux/spinlock.h:425 [inline]
dummy_queue+0x3c5/0xb80 drivers/usb/gadget/udc/dummy_hcd.c:773
usb_ep_queue+0xfa/0x3c0 drivers/usb/gadget/udc/core.c:306
raw_process_ep_io+0x64d/0xc40 drivers/usb/gadget/legacy/raw_gadget.c:1114
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1153 [inline]
raw_ioctl+0x25a/0x2b80 drivers/usb/gadget/legacy/raw_gadget.c:1325
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f4a81dbe1eb
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:00007f4a80815f60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f4a81dbe1eb
RDX: 00007f4a80815fe0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007f4a82170320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 0000200000000080
R13: 0000000000000000 R14: 00007f4a82045fa0 R15: 00007fffd5ac9428
Allocated by task 2856:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:409 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:426
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5414 [inline]
__kmalloc_node_track_caller_noprof+0x323/0x820 mm/slub.c:5545
kmalloc_reserve+0xe8/0x350 net/core/skbuff.c:637
__alloc_skb+0x185/0x710 net/core/skbuff.c:715
alloc_skb include/linux/skbuff.h:1384 [inline]
alloc_skb_with_frags+0xdd/0x760 net/core/skbuff.c:6799
sock_alloc_send_pskb+0x801/0x980 net/core/sock.c:3022
unix_dgram_sendmsg+0x3c7/0x1810 net/unix/af_unix.c:2144
sock_sendmsg_nosec net/socket.c:800 [inline]
__sock_sendmsg net/socket.c:815 [inline]
__sys_sendto+0x48b/0x4e0 net/socket.c:2281
__do_sys_sendto net/socket.c:2288 [inline]
__se_sys_sendto net/socket.c:2284 [inline]
__x64_sys_sendto+0xe0/0x1c0 net/socket.c:2284
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 2849:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:264 [inline]
__kasan_slab_free+0x43/0x70 mm/kasan/common.c:296
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2748 [inline]
slab_free mm/slub.c:6509 [inline]
kfree+0x20c/0x650 mm/slub.c:6802
skb_kfree_head net/core/skbuff.c:1083 [inline]
skb_free_head+0xb9/0x160 net/core/skbuff.c:1095
skb_release_data+0x659/0x860 net/core/skbuff.c:1122
skb_release_all net/core/skbuff.c:1197 [inline]
__kfree_skb net/core/skbuff.c:1211 [inline]
consume_skb net/core/skbuff.c:1448 [inline]
consume_skb+0xc4/0x110 net/core/skbuff.c:1442
__unix_dgram_recvmsg+0x754/0xc30 net/unix/af_unix.c:2672
unix_dgram_recvmsg+0xcd/0x100 net/unix/af_unix.c:2689
sock_recvmsg_nosec net/socket.c:1151 [inline]
sock_recvmsg+0x1d5/0x220 net/socket.c:1173
sock_read_iter+0x2b0/0x3a0 net/socket.c:1242
new_sync_read fs/read_write.c:493 [inline]
vfs_read+0x960/0xb40 fs/read_write.c:574
ksys_read+0x1f8/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888114213c00
which belongs to the cache kmalloc-cg-512 of size 512
The buggy address is located 511 bytes to the right of
allocated 512-byte region [ffff888114213c00, ffff888114213e00)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x114210
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff888114210211
flags: 0x200000000000040(head|node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000040 ffff88810004b140 dead000000000100 dead000000000122
raw: 0000000000000000 0000000300100010 00000000f5000000 ffff888114210211
head: 0200000000000040 ffff88810004b140 dead000000000100 dead000000000122
head: 0000000000000000 0000000300100010 00000000f5000000 ffff888114210211
head: 0200000000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff
head: 0000000000000000 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 2856, tgid 2856 (klogd), ts 1819513886214
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0xf4b/0x3440 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2d7/0x2f70 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab mm/slub.c:3462 [inline]
new_slab+0xa9/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7418
refill_sheaf mm/slub.c:2885 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
__do_kmalloc_node mm/slub.c:5413 [inline]
__kmalloc_node_track_caller_noprof+0x634/0x820 mm/slub.c:5545
kmalloc_reserve+0xe8/0x350 net/core/skbuff.c:637
__alloc_skb+0x185/0x710 net/core/skbuff.c:715
alloc_skb include/linux/skbuff.h:1384 [inline]
alloc_skb_with_frags+0xdd/0x760 net/core/skbuff.c:6799
sock_alloc_send_pskb+0x801/0x980 net/core/sock.c:3022
unix_dgram_sendmsg+0x3c7/0x1810 net/unix/af_unix.c:2144
sock_sendmsg_nosec net/socket.c:800 [inline]
__sock_sendmsg net/socket.c:815 [inline]
__sys_sendto+0x48b/0x4e0 net/socket.c:2281
__do_sys_sendto net/socket.c:2288 [inline]
__se_sys_sendto net/socket.c:2284 [inline]
__x64_sys_sendto+0xe0/0x1c0 net/socket.c:2284
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 125 tgid 125 ts 1818005120134 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
free_pages_prepare+0x558/0xd20 mm/page_alloc.c:1463
__free_contig_range_common.constprop.0+0x12c/0x230 mm/page_alloc.c:7072
__free_contig_range mm/page_alloc.c:7117 [inline]
free_pages_bulk+0x126/0x1f0 mm/page_alloc.c:5322
vm_area_free_pages+0xb2/0x2a0 mm/vmalloc.c:3461
vfree mm/vmalloc.c:3510 [inline]
vfree+0xf7/0x6d0 mm/vmalloc.c:3484
__free_kvfree include/linux/slab.h:1423 [inline]
hid_parse_collections drivers/hid/hid-core.c:1268 [inline]
hid_open_report.cold+0x71/0x161 drivers/hid/hid-core.c:1390
hid_parse include/linux/hid.h:1208 [inline]
kovaplus_probe+0x97/0x7d0 drivers/hid/hid-roccat-kovaplus.c:510
__hid_device_probe drivers/hid/hid-core.c:2839 [inline]
hid_device_probe+0x4fe/0x850 drivers/hid/hid-core.c:2878
call_driver_probe drivers/base/dd.c:628 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:706
__driver_probe_device+0x210/0x460 drivers/base/dd.c:868
driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
__device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4d0 drivers/base/dd.c:1098
device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1153
bus_probe_device+0x64/0x160 drivers/base/bus.c:620
Memory state around the buggy address:
ffff888114213e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888114213f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888114213f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888114214000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888114214080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: f5 cmc
1: 53 push %rbx
2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi
7: 48 89 fb mov %rdi,%rbx
a: 48 83 c7 18 add $0x18,%rdi
e: e8 b6 67 04 fa call 0xfa0467c9
13: 48 89 df mov %rbx,%rdi
16: e8 3e be 04 fa call 0xfa04be59
1b: f7 c5 00 02 00 00 test $0x200,%ebp
21: 75 23 jne 0x46
23: 9c pushf
24: 58 pop %rax
25: f6 c4 02 test $0x2,%ah
28: 75 37 jne 0x61
* 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction
2f: e8 75 02 f7 f9 call 0xf9f702a9
34: 65 48 83 3d b4 0e 98 cmpq $0x0,%gs:0x5980eb4(%rip) # 0x5980ef1
3b: 05 00
3d: 74 16 je 0x55
3f: 5b pop %rbx