==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:854
Read of size 1 at addr ffff888059ce3fff by task syz.2.132/6490
CPU: 1 UID: 0 PID: 6490 Comm: syz.2.132 Not tainted 6.16.0-rc5-syzkaller-00266-g3f31a806a62e #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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/0x610 mm/kasan/report.c:480
kasan_report+0xe0/0x110 mm/kasan/report.c:593
mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:854
__hid_input_report.constprop.0+0x314/0x450 drivers/hid/hid-core.c:2117
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38d/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: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:finish_task_switch.isra.0+0x22a/0xc10 kernel/sched/core.c:5265
Code: fb 09 00 00 44 8b 05 09 cb 1f 0f 45 85 c0 0f 85 be 01 00 00 4c 89 e7 e8 a4 f6 ff ff e8 df d5 39 00 fb 65 48 8b 1d be e2 46 12 <48> 8d bb 18 16 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1
RSP: 0018:ffffc900043bf910 EFLAGS: 00000206
RAX: 0000000000001fff RBX: ffff88807b790000 RCX: ffffffff81c3c22f
RDX: 0000000000000000 RSI: ffffffff8de32e47 RDI: ffffffff8c158f60
RBP: ffffc900043bf958 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff90a98657 R11: 0000000000000001 R12: ffff8880b853a2c0
R13: ffff888079c28000 R14: 0000000000000001 R15: ffff8880b853b130
context_switch kernel/sched/core.c:5400 [inline]
__schedule+0x1172/0x5de0 kernel/sched/core.c:6786
preempt_schedule_common+0x44/0xc0 kernel/sched/core.c:6966
preempt_schedule_thunk+0x16/0x30 arch/x86/entry/thunk.S:12
class_preempt_destructor include/linux/preempt.h:481 [inline]
class_preempt_destructor include/linux/preempt.h:481 [inline]
try_to_wake_up+0xa2f/0x1680 kernel/sched/core.c:4191
wake_up_process kernel/sched/core.c:4476 [inline]
wake_up_q+0xa3/0x160 kernel/sched/core.c:1081
futex_wake+0x43c/0x4e0 kernel/futex/waitwake.c:198
do_futex+0x1e3/0x350 kernel/futex/syscalls.c:107
__do_sys_futex kernel/futex/syscalls.c:179 [inline]
__se_sys_futex kernel/futex/syscalls.c:160 [inline]
__x64_sys_futex+0x1e0/0x4c0 kernel/futex/syscalls.c:160
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
RIP: 0033:0x7f9ff378e929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd802dba48 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00007f9ff39b5fa8 RCX: 00007f9ff378e929
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f9ff39b5fa8
RBP: 0000000000000000 R08: 0000000000000013 R09: 00000005802dbd3f
R10: 00007f9ff39b5fa0 R11: 0000000000000246 R12: 00007f9ff39b5fac
R13: 00007f9ff39b5fa0 R14: 0000000000001d5e R15: 0000000000000004
Allocated by task 5847:
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:377 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1039 [inline]
device_private_init drivers/base/core.c:3537 [inline]
device_add+0xccc/0x1a70 drivers/base/core.c:3588
netdev_register_kobject+0x182/0x3a0 net/core/net-sysfs.c:2336
register_netdevice+0x13dc/0x2270 net/core/dev.c:11105
veth_newlink+0x30f/0xa00 drivers/net/veth.c:1855
rtnl_newlink_create net/core/rtnetlink.c:3823 [inline]
__rtnl_newlink net/core/rtnetlink.c:3940 [inline]
rtnl_newlink+0xc42/0x2000 net/core/rtnetlink.c:4055
rtnetlink_rcv_msg+0x95b/0xe90 net/core/rtnetlink.c:6944
netlink_rcv_skb+0x158/0x420 net/netlink/af_netlink.c:2552
netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline]
netlink_unicast+0x58a/0x850 net/netlink/af_netlink.c:1346
netlink_sendmsg+0x8d1/0xdd0 net/netlink/af_netlink.c:1896
sock_sendmsg_nosec net/socket.c:712 [inline]
__sock_sendmsg net/socket.c:727 [inline]
__sys_sendto+0x4a0/0x520 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/0x4c0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888059ce3c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 751 bytes to the right of
allocated 272-byte region [ffff888059ce3c00, ffff888059ce3d10)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x59ce0
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: f5(slab)
raw: 00fff00000000040 ffff88801b841c80 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b841c80 dead000000000122 0000000000000000
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0001673801 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5839, tgid 5839 (syz-executor), ts 72869768728, free_ts 16252349529
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1704
prep_new_page mm/page_alloc.c:1712 [inline]
get_page_from_freelist+0x1321/0x3890 mm/page_alloc.c:3669
__alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4959
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2419
alloc_slab_page mm/slub.c:2451 [inline]
allocate_slab mm/slub.c:2619 [inline]
new_slab+0x23b/0x330 mm/slub.c:2673
___slab_alloc+0xd9c/0x1940 mm/slub.c:3859
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3949
__slab_alloc_node mm/slub.c:4024 [inline]
slab_alloc_node mm/slub.c:4185 [inline]
__kmalloc_cache_noprof+0xfb/0x3e0 mm/slub.c:4354
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1039 [inline]
mca_alloc net/ipv6/mcast.c:884 [inline]
__ipv6_dev_mc_inc+0x2b9/0xc10 net/ipv6/mcast.c:975
ipv6_add_dev+0xbce/0x15f0 net/ipv6/addrconf.c:473
addrconf_notify+0x53e/0x19e0 net/ipv6/addrconf.c:3649
notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2230
call_netdevice_notifiers_extack net/core/dev.c:2268 [inline]
call_netdevice_notifiers net/core/dev.c:2282 [inline]
register_netdevice+0x182e/0x2270 net/core/dev.c:11143
veth_newlink+0x446/0xa00 drivers/net/veth.c:1884
rtnl_newlink_create net/core/rtnetlink.c:3823 [inline]
__rtnl_newlink net/core/rtnetlink.c:3940 [inline]
rtnl_newlink+0xc42/0x2000 net/core/rtnetlink.c:4055
page last free pid 1 tgid 1 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1248 [inline]
__free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2706
__free_pages mm/page_alloc.c:5071 [inline]
free_contig_range+0x183/0x4b0 mm/page_alloc.c:6927
destroy_args+0x7f6/0xa60 mm/debug_vm_pgtable.c:1009
debug_vm_pgtable+0x13b8/0x2d00 mm/debug_vm_pgtable.c:1389
do_one_initcall+0x120/0x6e0 init/main.c:1274
do_initcall_level init/main.c:1336 [inline]
do_initcalls init/main.c:1352 [inline]
do_basic_setup init/main.c:1371 [inline]
kernel_init_freeable+0x5c2/0x900 init/main.c:1584
kernel_init+0x1c/0x2b0 init/main.c:1474
ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff888059ce3e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888059ce3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888059ce3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888059ce4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888059ce4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess), 2 bytes skipped:
0: 00 00 add %al,(%rax)
2: 44 8b 05 09 cb 1f 0f mov 0xf1fcb09(%rip),%r8d # 0xf1fcb12
9: 45 85 c0 test %r8d,%r8d
c: 0f 85 be 01 00 00 jne 0x1d0
12: 4c 89 e7 mov %r12,%rdi
15: e8 a4 f6 ff ff call 0xfffff6be
1a: e8 df d5 39 00 call 0x39d5fe
1f: fb sti
20: 65 48 8b 1d be e2 46 mov %gs:0x1246e2be(%rip),%rbx # 0x1246e2e6
27: 12
* 28: 48 8d bb 18 16 00 00 lea 0x1618(%rbx),%rdi <-- trapping instruction
2f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
36: fc ff df
39: 48 89 fa mov %rdi,%rdx
3c: 48 rex.W
3d: c1 .byte 0xc1