==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88804bac7fff by task syz.7.2717/17249
CPU: 1 UID: 0 PID: 17249 Comm: syz.7.2717 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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:unwind_next_frame+0x504/0x20a0 arch/x86/kernel/unwind_orc.c:505
Code: 00 00 4c 89 f9 4c 89 c7 e8 19 f1 ff ff 48 89 c1 48 85 c0 0f 84 05 fe ff ff 48 b8 00 00 00 00 00 fc ff df 4c 8d 79 05 4c 89 fa <48> c1 ea 03 0f b6 04 02 4c 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85
RSP: 0018:ffffc90003376e58 EFLAGS: 00000282
RAX: dffffc0000000000 RBX: 0000000000000001 RCX: ffffffff914ec8e6
RDX: ffffffff914ec8eb RSI: 0000000000000000 RDI: ffffffff90c5a844
RBP: ffffc90003376f10 R08: ffffffff914ec8ec R09: 0000000000000000
R10: 0000000000000001 R11: 00000000000118df R12: ffffc90003376f18
R13: ffffc90003376ec8 R14: ffffc90003376efd R15: ffffffff914ec8eb
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
__reset_page_owner+0x84/0x1a0 mm/page_owner.c:308
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
free_unref_folios+0xa61/0x16b0 mm/page_alloc.c:2952
folios_put_refs+0x56f/0x740 mm/swap.c:997
free_pages_and_swap_cache+0x245/0x4a0 mm/swap_state.c:264
__tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136
tlb_batch_pages_flush mm/mmu_gather.c:149 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:397 [inline]
tlb_flush_mmu+0xe9/0x5a0 mm/mmu_gather.c:404
zap_pte_range mm/memory.c:1765 [inline]
zap_pmd_range mm/memory.c:1818 [inline]
zap_pud_range mm/memory.c:1847 [inline]
zap_p4d_range mm/memory.c:1868 [inline]
unmap_page_range+0x1f43/0x42c0 mm/memory.c:1889
unmap_single_vma.constprop.0+0x153/0x240 mm/memory.c:1932
unmap_vmas+0x218/0x470 mm/memory.c:1976
exit_mmap+0x1b9/0xb90 mm/mmap.c:1280
__mmput+0x12a/0x410 kernel/fork.c:1129
mmput+0x62/0x70 kernel/fork.c:1152
exit_mm kernel/exit.c:582 [inline]
do_exit+0x7c7/0x2bf0 kernel/exit.c:949
do_group_exit+0xd3/0x2a0 kernel/exit.c:1102
get_signal+0x2673/0x26d0 kernel/signal.c:3034
arch_do_signal_or_restart+0x8f/0x7d0 arch/x86/kernel/signal.c:337
exit_to_user_mode_loop+0x84/0x110 kernel/entry/common.c:40
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x3f6/0x4c0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff9bd38ebe9
Code: Unable to access opcode bytes at 0x7ff9bd38ebbf.
RSP: 002b:00007ff9be18e038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: 0000000000010106 RBX: 00007ff9bd5c6090 RCX: 00007ff9bd38ebe9
RDX: 0000000000010106 RSI: 00002000000000c0 RDI: 0000000000000008
RBP: 00007ff9bd411e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff9bd5c6128 R14: 00007ff9bd5c6090 R15: 00007ffea2ed2698
Allocated by task 15746:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405
kasan_kmalloc include/linux/kasan.h:260 [inline]
__do_kmalloc_node mm/slub.c:4376 [inline]
__kmalloc_noprof+0x223/0x510 mm/slub.c:4388
kmalloc_noprof include/linux/slab.h:909 [inline]
tomoyo_realpath_from_path+0xc2/0x6e0 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x274/0x460 security/tomoyo/file.c:822
tomoyo_path_unlink+0x91/0xe0 security/tomoyo/tomoyo.c:162
security_path_unlink+0x145/0x2b0 security/security.c:1965
do_unlinkat+0x463/0x6a0 fs/namei.c:4647
__do_sys_unlink fs/namei.c:4696 [inline]
__se_sys_unlink fs/namei.c:4694 [inline]
__x64_sys_unlink+0xc5/0x110 fs/namei.c:4694
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
Freed by task 15746:
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:243 [inline]
__kasan_slab_free+0x60/0x70 mm/kasan/common.c:275
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2422 [inline]
slab_free mm/slub.c:4695 [inline]
kfree+0x2b4/0x4d0 mm/slub.c:4894
tomoyo_realpath_from_path+0x19f/0x6e0 security/tomoyo/realpath.c:286
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x274/0x460 security/tomoyo/file.c:822
tomoyo_path_unlink+0x91/0xe0 security/tomoyo/tomoyo.c:162
security_path_unlink+0x145/0x2b0 security/security.c:1965
do_unlinkat+0x463/0x6a0 fs/namei.c:4647
__do_sys_unlink fs/namei.c:4696 [inline]
__se_sys_unlink fs/namei.c:4694 [inline]
__x64_sys_unlink+0xc5/0x110 fs/namei.c:4694
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 ffff88804bac6000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 4095 bytes to the right of
allocated 4096-byte region [ffff88804bac6000, ffff88804bac7000)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4bac0
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 ffff88801b842140 ffffea0000af2200 dead000000000002
raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b842140 ffffea0000af2200 dead000000000002
head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea00012eb001 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 15949, tgid 15949 (kworker/u8:18), ts 887339062592, free_ts 825277134495
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]
__do_kmalloc_node mm/slub.c:4375 [inline]
__kmalloc_node_track_caller_noprof+0x2ee/0x510 mm/slub.c:4395
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:600
__alloc_skb+0x166/0x380 net/core/skbuff.c:669
alloc_skb include/linux/skbuff.h:1336 [inline]
nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:763 [inline]
nsim_dev_trap_report drivers/net/netdevsim/dev.c:820 [inline]
nsim_dev_trap_report_work+0x2b1/0xcf0 drivers/net/netdevsim/dev.c:866
process_one_work+0x9cc/0x1b70 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3319 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400
kthread+0x3c2/0x780 kernel/kthread.c:463
ret_from_fork+0x5d4/0x6f0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
page last free pid 15741 tgid 15741 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_node_noprof+0x217/0x420 mm/slub.c:4415
kmalloc_node_noprof include/linux/slab.h:928 [inline]
page_pool_create_percpu+0x7a/0xcb0 net/core/page_pool.c:343
nsim_create_page_pool drivers/net/netdevsim/netdev.c:457 [inline]
nsim_init_napi drivers/net/netdevsim/netdev.c:480 [inline]
nsim_open+0x395/0x9d0 drivers/net/netdevsim/netdev.c:535
__dev_open+0x2e7/0x7c0 net/core/dev.c:1682
__dev_change_flags+0x55d/0x720 net/core/dev.c:9549
netif_change_flags+0x8d/0x160 net/core/dev.c:9612
do_setlink.constprop.0+0xb53/0x4380 net/core/rtnetlink.c:3143
rtnl_changelink net/core/rtnetlink.c:3761 [inline]
__rtnl_newlink net/core/rtnetlink.c:3920 [inline]
rtnl_newlink+0x1446/0x2000 net/core/rtnetlink.c:4057
rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6946
netlink_rcv_skb+0x155/0x420 net/netlink/af_netlink.c:2552
netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1346
Memory state around the buggy address:
ffff88804bac7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88804bac7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88804bac7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88804bac8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88804bac8080: 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: 4c 89 f9 mov %r15,%rcx
5: 4c 89 c7 mov %r8,%rdi
8: e8 19 f1 ff ff call 0xfffff126
d: 48 89 c1 mov %rax,%rcx
10: 48 85 c0 test %rax,%rax
13: 0f 84 05 fe ff ff je 0xfffffe1e
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 4c 8d 79 05 lea 0x5(%rcx),%r15
27: 4c 89 fa mov %r15,%rdx
* 2a: 48 c1 ea 03 shr $0x3,%rdx <-- trapping instruction
2e: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax
32: 4c 89 fa mov %r15,%rdx
35: 83 e2 07 and $0x7,%edx
38: 38 d0 cmp %dl,%al
3a: 7f 08 jg 0x44
3c: 84 c0 test %al,%al
3e: 0f .byte 0xf
3f: 85 .byte 0x85