==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:852
Read of size 1 at addr ffff888135583fff by task syz.3.3144/17298
CPU: 0 UID: 0 PID: 17298 Comm: syz.3.3144 Not tainted 6.15.0-rc4-syzkaller-00104-g588d032e9e56 #0 PREEMPT(voluntary)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/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:408 [inline]
print_report+0xc3/0x670 mm/kasan/report.c:521
kasan_report+0xe0/0x110 mm/kasan/report.c:634
mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:852
__hid_input_report.constprop.0+0x311/0x450 drivers/hid/hid-core.c:2117
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38a/0x6e0 drivers/usb/core/hcd.c:1650
usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1734
dummy_timer+0x180e/0x3a20 drivers/usb/gadget/udc/dummy_hcd.c:1994
__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+0x205/0x8d0 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xfa/0x160 kernel/softirq.c:680
irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1049
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:lock_is_held_type+0x107/0x150 kernel/locking/lockdep.c:5943
Code: 00 00 b8 ff ff ff ff 65 0f c1 05 2c c4 41 05 83 f8 01 75 2d 9c 58 f6 c4 02 75 43 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 45 31 ed eb
RSP: 0018:ffffc9000218fac8 EFLAGS: 00000282
RAX: 0000000000000046 RBX: ffff8881f5838400 RCX: 0000000000000001
RDX: 0000000000000000 RSI: ffffffff88ab8acb RDI: ffffffff876851e0
RBP: ffffffff890c2820 R08: 0000000000000000 R09: fffffbfff14f1812
R10: ffffffff8a78c097 R11: 0000000000000000 R12: ffff888111728000
R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000000
lock_is_held include/linux/lockdep.h:249 [inline]
schedule_debug kernel/sched/core.c:5968 [inline]
__schedule+0x194b/0x3b00 kernel/sched/core.c:6666
__schedule_loop kernel/sched/core.c:6845 [inline]
schedule+0xe7/0x3a0 kernel/sched/core.c:6860
do_nanosleep+0x21a/0x570 kernel/time/hrtimer.c:2100
hrtimer_nanosleep+0x155/0x380 kernel/time/hrtimer.c:2147
common_nsleep+0xa1/0xd0 kernel/time/posix-timers.c:1361
__do_sys_clock_nanosleep kernel/time/posix-timers.c:1407 [inline]
__se_sys_clock_nanosleep kernel/time/posix-timers.c:1384 [inline]
__x64_sys_clock_nanosleep+0x34a/0x4a0 kernel/time/posix-timers.c:1384
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f13db051225
Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 f6 54 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 4f 55 ff ff 48 8b 04 24 48 83 c4 28 f7 d8
RSP: 002b:00007f13d9685f60 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f13db051225
RDX: 00007f13d9685fa0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000200000000040
R13: 0000000000000000 R14: 00007f13db245fa0 R15: 00007ffeecc8f3c8
Allocated by task 17221:
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:319 [inline]
__kasan_slab_alloc+0x6e/0x70 mm/kasan/common.c:345
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4161 [inline]
slab_alloc_node mm/slub.c:4210 [inline]
kmem_cache_alloc_noprof+0x14f/0x3b0 mm/slub.c:4217
mt_alloc_one lib/maple_tree.c:176 [inline]
mas_alloc_nodes+0x18b/0x8b0 lib/maple_tree.c:1249
mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1331
mas_preallocate+0x53e/0xcd0 lib/maple_tree.c:5501
vma_iter_prealloc mm/vma.h:409 [inline]
__split_vma+0x33b/0xff0 mm/vma.c:490
vms_gather_munmap_vmas+0x1c2/0x1280 mm/vma.c:1315
__mmap_prepare mm/vma.c:2303 [inline]
__mmap_region+0x31b/0x2620 mm/vma.c:2506
mmap_region+0x1ab/0x3f0 mm/vma.c:2597
do_mmap+0xd8e/0x11b0 mm/mmap.c:561
vm_mmap_pgoff+0x201/0x390 mm/util.c:579
ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:607
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 14:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
poison_slab_object mm/kasan/common.c:247 [inline]
__kasan_slab_free+0x37/0x50 mm/kasan/common.c:264
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2398 [inline]
slab_free mm/slub.c:4656 [inline]
kmem_cache_free+0x2a3/0x470 mm/slub.c:4758
rcu_do_batch kernel/rcu/tree.c:2568 [inline]
rcu_core+0x799/0x14e0 kernel/rcu/tree.c:2824
handle_softirqs+0x205/0x8d0 kernel/softirq.c:579
run_ksoftirqd kernel/softirq.c:968 [inline]
run_ksoftirqd+0x3a/0x60 kernel/softirq.c:960
smpboot_thread_fn+0x3f4/0xae0 kernel/smpboot.c:164
kthread+0x3c2/0x780 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Last potentially related work creation:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_record_aux_stack+0x9b/0xb0 mm/kasan/generic.c:548
__call_rcu_common.constprop.0+0x9a/0x9f0 kernel/rcu/tree.c:3082
mas_topiary_node lib/maple_tree.c:2519 [inline]
mas_topiary_replace+0x1723/0x3510 lib/maple_tree.c:2625
mas_wmb_replace lib/maple_tree.c:2641 [inline]
mas_split+0xb96/0x1210 lib/maple_tree.c:3368
mas_commit_b_node.isra.0+0x76/0xb0 lib/maple_tree.c:3388
mas_wr_bnode+0x13c/0x1c0 lib/maple_tree.c:4049
mas_wr_store_entry+0xefd/0x2550 lib/maple_tree.c:4090
mas_store_prealloc+0x77d/0x1690 lib/maple_tree.c:5475
vma_iter_store_new mm/vma.h:455 [inline]
vma_complete+0x991/0xe30 mm/vma.c:323
__split_vma+0xbb0/0xff0 mm/vma.c:523
vms_gather_munmap_vmas+0x392/0x1280 mm/vma.c:1336
__mmap_prepare mm/vma.c:2303 [inline]
__mmap_region+0x31b/0x2620 mm/vma.c:2506
mmap_region+0x1ab/0x3f0 mm/vma.c:2597
do_mmap+0xd8e/0x11b0 mm/mmap.c:561
vm_mmap_pgoff+0x201/0x390 mm/util.c:579
ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:607
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888135583e00
which belongs to the cache maple_node of size 256
The buggy address is located 255 bytes to the right of
allocated 256-byte region [ffff888135583e00, ffff888135583f00)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x135582
head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x200000000000040(head|node=0|zone=2)
page_type: f5(slab)
raw: 0200000000000040 ffff888100091000 ffffea0004596e00 0000000000000004
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 0200000000000040 ffff888100091000 ffffea0004596e00 0000000000000004
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 0200000000000001 ffffea0004d56081 00000000ffffffff 00000000ffffffff
head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000002
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 16854, tgid 16854 (modprobe), ts 1618566929404, free_ts 1612695799443
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1718
prep_new_page mm/page_alloc.c:1726 [inline]
get_page_from_freelist+0xfec/0x2d90 mm/page_alloc.c:3688
__alloc_frozen_pages_noprof+0x25c/0x2160 mm/page_alloc.c:4970
alloc_pages_mpol+0xe4/0x410 mm/mempolicy.c:2301
alloc_slab_page mm/slub.c:2468 [inline]
allocate_slab mm/slub.c:2632 [inline]
new_slab+0x244/0x340 mm/slub.c:2686
___slab_alloc+0xda5/0x1940 mm/slub.c:3872
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3962
__slab_alloc_node mm/slub.c:4037 [inline]
slab_alloc_node mm/slub.c:4198 [inline]
kmem_cache_alloc_noprof+0x1f9/0x3b0 mm/slub.c:4217
mt_alloc_one lib/maple_tree.c:176 [inline]
mas_alloc_nodes+0x18b/0x8b0 lib/maple_tree.c:1249
mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1331
mas_preallocate+0x53e/0xcd0 lib/maple_tree.c:5501
vma_iter_prealloc mm/vma.h:409 [inline]
vma_link+0x135/0x6a0 mm/vma.c:1750
insert_vm_struct+0x196/0x3e0 mm/mmap.c:1357
__install_special_mapping mm/mmap.c:1507 [inline]
_install_special_mapping+0x187/0x3d0 mm/mmap.c:1543
map_vdso+0x1a3/0x580 arch/x86/entry/vdso/vma.c:174
arch_setup_additional_pages+0x33/0x50 arch/x86/entry/vdso/vma.c:246
page last free pid 2830 tgid 2830 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1262 [inline]
__free_frozen_pages+0x66c/0xe70 mm/page_alloc.c:2725
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4161 [inline]
slab_alloc_node mm/slub.c:4210 [inline]
kmem_cache_alloc_node_noprof+0x14d/0x3a0 mm/slub.c:4262
__alloc_skb+0x2b2/0x380 net/core/skbuff.c:658
alloc_skb include/linux/skbuff.h:1340 [inline]
alloc_skb_with_frags+0xe0/0x860 net/core/skbuff.c:6639
sock_alloc_send_pskb+0x7fb/0x990 net/core/sock.c:2954
unix_dgram_sendmsg+0x45a/0x1860 net/unix/af_unix.c:2007
sock_sendmsg_nosec net/socket.c:712 [inline]
__sock_sendmsg net/socket.c:727 [inline]
__sys_sendto+0x495/0x510 net/socket.c:2180
__do_sys_sendto net/socket.c:2187 [inline]
__se_sys_sendto net/socket.c:2183 [inline]
__x64_sys_sendto+0xe0/0x1c0 net/socket.c:2183
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff888135583e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888135583f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888135583f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888135584000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888135584080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: b8 ff ff ff ff mov $0xffffffff,%eax
7: 65 0f c1 05 2c c4 41 xadd %eax,%gs:0x541c42c(%rip) # 0x541c43b
e: 05
f: 83 f8 01 cmp $0x1,%eax
12: 75 2d jne 0x41
14: 9c pushf
15: 58 pop %rax
16: f6 c4 02 test $0x2,%ah
19: 75 43 jne 0x5e
1b: 48 f7 04 24 00 02 00 testq $0x200,(%rsp)
22: 00
23: 74 01 je 0x26
25: fb sti
26: 48 83 c4 08 add $0x8,%rsp
* 2a: 44 89 e8 mov %r13d,%eax <-- trapping instruction
2d: 5b pop %rbx
2e: 5d pop %rbp
2f: 41 5c pop %r12
31: 41 5d pop %r13
33: 41 5e pop %r14
35: 41 5f pop %r15
37: c3 ret
38: cc int3
39: cc int3
3a: cc int3
3b: cc int3
3c: 45 31 ed xor %r13d,%r13d
3f: eb .byte 0xeb