==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88806c4e3fff by task syz.0.92/6209
CPU: 0 UID: 0 PID: 6209 Comm: syz.0.92 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:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202
Code: 90 f3 0f 1e fa 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 0a ef 3d f6 48 89 df e8 62 86 3e f6 e8 ed 78 68 f6 fb bf 01 00 00 00 52 76 30 f6 65 8b 05 eb e3 57 07 85 c0 74 07 5b e9 91 4c 00 00
RSP: 0018:ffffc90017c17870 EFLAGS: 00000282
RAX: 804141bc695b5d00 RBX: ffffc90017c17a88 RCX: 804141bc695b5d00
RDX: 0000000000000000 RSI: ffffffff8da75c2f RDI: 0000000000000001
RBP: ffffc90017c179e8 R08: ffffffff8fbef977 R09: 1ffffffff1f7df2e
R10: dffffc0000000000 R11: fffffbfff1f7df2f R12: dffffc0000000000
R13: 0000000000000001 R14: 7fffffffffffffff R15: ffffc90017c17a80
__wait_for_common+0x613/0x710 kernel/sched/completion.c:122
wait_for_common kernel/sched/completion.c:132 [inline]
wait_for_completion_interruptible+0x1f/0x40 kernel/sched/completion.c:221
raw_process_ep_io+0x5ba/0xd60 drivers/usb/gadget/legacy/raw_gadget.c:1119
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1150 [inline]
raw_ioctl+0x1fa4/0x4050 drivers/usb/gadget/legacy/raw_gadget.c:1322
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:0x7efed3b8ebcb
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:00007efed4a5ef70 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007efed3b8ebcb
RDX: 00007efed4a5eff0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007efed3f10320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 00002000000004c0
R13: 0000000000000000 R14: 00007efed3de5fa0 R15: 00007fff407dfa58
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7fae82a98 pfn:0x6c4e0
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: f8(unknown)
raw: 00fff00000000040 0000000000000000 dead000000000122 0000000000000000
raw: 00000007fae82a98 0000000000000000 00000000f8000000 0000000000000000
head: 00fff00000000040 0000000000000000 dead000000000122 0000000000000000
head: 00000007fae82a98 0000000000000000 00000000f8000000 0000000000000000
head: 00fff00000000002 ffffea0001b13801 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 0x446dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP), pid 5831, tgid 5831 (syz-executor), ts 91558952549, free_ts 82242585760
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
___kmalloc_large_node+0x5f/0x1b0 mm/slub.c:5597
__kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:5628
__do_kmalloc_node mm/slub.c:5644 [inline]
__kvmalloc_node_noprof+0x6e/0x910 mm/slub.c:7115
alloc_netdev_mqs+0xa8/0x1200 net/core/dev.c:11963
ieee80211_if_add+0x46c/0x1390 net/mac80211/iface.c:2185
ieee80211_register_hw+0x35d9/0x4110 net/mac80211/main.c:1608
mac80211_hwsim_new_radio+0x2f85/0x5340 drivers/net/wireless/virtual/mac80211_hwsim.c:5804
hwsim_new_radio_nl+0xf5b/0x1bd0 drivers/net/wireless/virtual/mac80211_hwsim.c:6498
genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115
genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210
netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2550
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
page last free pid 5812 tgid 5812 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
free_unref_folios+0xd22/0x1460 mm/page_alloc.c:3005
folios_put_refs+0x584/0x670 mm/swap.c:1002
free_pages_and_swap_cache+0x277/0x520 mm/swap_state.c:355
__tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline]
tlb_batch_pages_flush mm/mmu_gather.c:149 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:397 [inline]
tlb_flush_mmu+0x3a0/0x680 mm/mmu_gather.c:404
tlb_finish_mmu+0xc3/0x1d0 mm/mmu_gather.c:497
vms_clear_ptes+0x42c/0x540 mm/vma.c:1237
vms_complete_munmap_vmas+0x206/0x8a0 mm/vma.c:1279
do_vmi_align_munmap+0x364/0x440 mm/vma.c:1538
do_vmi_munmap+0x253/0x2e0 mm/vma.c:1586
__vm_munmap+0x207/0x380 mm/vma.c:3196
__do_sys_munmap mm/mmap.c:1077 [inline]
__se_sys_munmap mm/mmap.c:1074 [inline]
__x64_sys_munmap+0x60/0x70 mm/mmap.c:1074
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:
ffff88806c4e3e80: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
ffff88806c4e3f00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
>ffff88806c4e3f80: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
^
ffff88806c4e4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88806c4e4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 90 nop
1: f3 0f 1e fa endbr64
5: 53 push %rbx
6: 48 89 fb mov %rdi,%rbx
9: 48 83 c7 18 add $0x18,%rdi
d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
12: e8 0a ef 3d f6 call 0xf63def21
17: 48 89 df mov %rbx,%rdi
1a: e8 62 86 3e f6 call 0xf63e8681
1f: e8 ed 78 68 f6 call 0xf6687911
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 52 76 30 f6 call 0xf6307681 <-- trapping instruction
2f: 65 8b 05 eb e3 57 07 mov %gs:0x757e3eb(%rip),%eax # 0x757e421
36: 85 c0 test %eax,%eax
38: 74 07 je 0x41
3a: 5b pop %rbx
3b: e9 91 4c 00 00 jmp 0x4cd1