syzbot


KASAN: slab-out-of-bounds Read in mcp2221_raw_event (2)

Status: upstream: reported on 2025/10/13 04:00
Subsystems: input usb
[Documentation on labels]
Reported-by: syzbot+1018672fe70298606e5f@syzkaller.appspotmail.com
First crash: 4d12h, last: 29m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [input?] [usb?] KASAN: slab-out-of-bounds Read in mcp2221_raw_event (2) 0 (1) 2025/10/13 04:00
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in mcp2221_raw_event input usb 19 C 1144 5d00h 310d 29/29 fixed on 2025/10/09 01:15
linux-6.6 KASAN: use-after-free Read in mcp2221_raw_event 19 6 89d 114d 0/2 upstream: reported on 2025/06/21 10:55

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff888035ac7fff by task syz.3.5122/25101

CPU: 0 UID: 0 PID: 25101 Comm: syz.3.5122 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <IRQ>
 __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+0x314/0x450 drivers/hid/hid-core.c:2139
 hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
 __usb_hcd_giveback_urb+0x38b/0x610 drivers/usb/core/hcd.c:1661
 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745
 dummy_timer+0x1809/0x3a00 drivers/usb/gadget/udc/dummy_hcd.c:1995
 __run_hrtimer kernel/time/hrtimer.c:1777 [inline]
 __hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1841
 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858
 handle_softirqs+0x219/0x8e0 kernel/softirq.c:622
 __do_softirq kernel/softirq.c:656 [inline]
 invoke_softirq kernel/softirq.c:496 [inline]
 __irq_exit_rcu+0x109/0x170 kernel/softirq.c:723
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1052
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:sched_mm_cid_fork+0x0/0xc0 kernel/sched/core.c:10889
Code: e9 1b ff ff ff e8 a0 71 99 00 e9 49 ff ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 <0f> 1f 40 d6 48 b8 00 00 00 00 00 fc ff df 53 48 89 fb 48 81 c7 98
RSP: 0018:ffffc90005d47a88 EFLAGS: 00000246
RAX: dffffc0000000000 RBX: ffff888062040000 RCX: ffffffff817af45a
RDX: 1ffff11003b7e544 RSI: ffffffff817af466 RDI: ffff88801dbf2480
RBP: ffffc90005d47bf8 R08: 0000000000000001 R09: ffffed100c408018
R10: ffff8880620400c7 R11: 0000000000000001 R12: 0000000000000100
R13: ffff88801dbf2ac8 R14: 00000000003d0f00 R15: ffff88801dbf2480
 copy_mm kernel/fork.c:1548 [inline]
 copy_process+0x2818/0x76a0 kernel/fork.c:2181
 kernel_clone+0xfc/0x930 kernel/fork.c:2609
 __do_sys_clone3+0x212/0x290 kernel/fork.c:2911
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1b91fc3609
Code: d7 08 00 48 8d 3d 9c d7 08 00 e8 e2 28 f6 ff 66 90 b8 ea ff ff ff 48 85 ff 74 2c 48 85 d2 74 27 49 89 c8 b8 b3 01 00 00 0f 05 <48> 85 c0 7c 18 74 01 c3 31 ed 48 83 e4 f0 4c 89 c7 ff d2 48 89 c7
RSP: 002b:00007ffd4ddd4368 EFLAGS: 00000206 ORIG_RAX: 00000000000001b3
RAX: ffffffffffffffda RBX: 00007f1b91f459f0 RCX: 00007f1b91fc3609
RDX: 00007f1b91f459f0 RSI: 0000000000000058 RDI: 00007ffd4ddd43b0
RBP: 00007f1b901d56c0 R08: 00007f1b901d56c0 R09: 00007ffd4ddd4497
R10: 0000000000000008 R11: 0000000000000206 R12: ffffffffffffffa8
R13: 000000000000006e R14: 00007ffd4ddd43b0 R15: 00007ffd4ddd4498
 </TASK>

Allocated by task 25074:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
 kasan_save_track+0x14/0x30 mm/kasan/common.c:77
 poison_kmalloc_redzone mm/kasan/common.c:400 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417
 kasan_kmalloc include/linux/kasan.h:262 [inline]
 __do_kmalloc_node mm/slub.c:5627 [inline]
 __kmalloc_node_track_caller_noprof+0x345/0x8a0 mm/slub.c:5736
 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:601
 __alloc_skb+0x166/0x380 net/core/skbuff.c:670
 alloc_skb include/linux/skbuff.h:1383 [inline]
 netlink_dump+0x644/0xd30 net/netlink/af_netlink.c:2286
 netlink_recvmsg+0x7dc/0xa90 net/netlink/af_netlink.c:1978
 sock_recvmsg_nosec net/socket.c:1078 [inline]
 ____sys_recvmsg+0x5f9/0x6b0 net/socket.c:2848
 ___sys_recvmsg+0x114/0x1a0 net/socket.c:2892
 do_recvmmsg+0x2fe/0x750 net/socket.c:2987
 __sys_recvmmsg net/socket.c:3061 [inline]
 __do_sys_recvmmsg net/socket.c:3084 [inline]
 __se_sys_recvmmsg net/socket.c:3077 [inline]
 __x64_sys_recvmmsg+0x22a/0x280 net/socket.c:3077
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 0:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
 kasan_save_track+0x14/0x30 mm/kasan/common.c:77
 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587
 kasan_save_free_info mm/kasan/kasan.h:406 [inline]
 poison_slab_object mm/kasan/common.c:252 [inline]
 __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284
 kasan_slab_free include/linux/kasan.h:234 [inline]
 slab_free_hook mm/slub.c:2523 [inline]
 slab_free mm/slub.c:6611 [inline]
 kfree+0x2b8/0x6d0 mm/slub.c:6818
 skb_kfree_head net/core/skbuff.c:1048 [inline]
 skb_free_head+0x114/0x210 net/core/skbuff.c:1060
 skb_release_data+0x795/0x9e0 net/core/skbuff.c:1087
 skb_release_all net/core/skbuff.c:1152 [inline]
 __kfree_skb net/core/skbuff.c:1166 [inline]
 sk_skb_reason_drop+0x129/0x1a0 net/core/skbuff.c:1204
 kfree_skb_reason include/linux/skbuff.h:1322 [inline]
 __skb_queue_purge_reason include/linux/skbuff.h:3425 [inline]
 skb_queue_purge_reason+0x2b0/0x420 net/core/skbuff.c:3949
 skb_queue_purge include/linux/skbuff.h:3438 [inline]
 netlink_sock_destruct+0x23/0x1c0 net/netlink/af_netlink.c:395
 __sk_destruct+0x84/0x9a0 net/core/sock.c:2339
 sk_destruct+0xc2/0xf0 net/core/sock.c:2401
 __sk_free+0xf4/0x3e0 net/core/sock.c:2412
 sk_free+0x6a/0x90 net/core/sock.c:2423
 deferred_put_nlk_sk+0xc9/0x110 net/netlink/af_netlink.c:716
 rcu_do_batch kernel/rcu/tree.c:2605 [inline]
 rcu_core+0x79c/0x1530 kernel/rcu/tree.c:2861
 handle_softirqs+0x219/0x8e0 kernel/softirq.c:622
 __do_softirq kernel/softirq.c:656 [inline]
 invoke_softirq kernel/softirq.c:496 [inline]
 __irq_exit_rcu+0x109/0x170 kernel/softirq.c:723
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1052
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697

The buggy address belongs to the object at ffff888035ac4000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 8191 bytes to the right of
 allocated 8192-byte region [ffff888035ac4000, ffff888035ac6000)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x35ac0
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88813ff27280 ffffea0001b84c00 dead000000000003
raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88813ff27280 ffffea0001b84c00 dead000000000003
head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0000d6b001 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 0x528c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP), pid 5826, tgid 5826 (syz-executor), ts 72496656961, free_ts 51636424457
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850
 prep_new_page mm/page_alloc.c:1858 [inline]
 get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884
 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183
 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
 alloc_slab_page mm/slub.c:3039 [inline]
 allocate_slab mm/slub.c:3212 [inline]
 new_slab+0x24a/0x360 mm/slub.c:3266
 ___slab_alloc+0xdc4/0x1ae0 mm/slub.c:4636
 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4755
 __slab_alloc_node mm/slub.c:4831 [inline]
 slab_alloc_node mm/slub.c:5253 [inline]
 __do_kmalloc_node mm/slub.c:5626 [inline]
 __kvmalloc_node_noprof+0x5aa/0x9c0 mm/slub.c:7081
 kvmalloc_array_node_noprof include/linux/slab.h:1122 [inline]
 __ptr_ring_init_queue_alloc_noprof include/linux/ptr_ring.h:481 [inline]
 ptr_ring_init_noprof include/linux/ptr_ring.h:499 [inline]
 wg_packet_queue_init+0x9a/0x360 drivers/net/wireguard/queueing.c:32
 wg_newlink+0x332/0x780 drivers/net/wireguard/device.c:357
 rtnl_newlink_create net/core/rtnetlink.c:3833 [inline]
 __rtnl_newlink net/core/rtnetlink.c:3950 [inline]
 rtnl_newlink+0xc45/0x2000 net/core/rtnetlink.c:4065
 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6954
 netlink_rcv_skb+0x158/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
 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1896
 sock_sendmsg_nosec net/socket.c:727 [inline]
 __sock_sendmsg net/socket.c:742 [inline]
 __sys_sendto+0x4a3/0x520 net/socket.c:2244
page last free pid 5736 tgid 5736 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1394 [inline]
 __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906
 discard_slab mm/slub.c:3310 [inline]
 __put_partials+0x130/0x170 mm/slub.c:3857
 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:352
 kasan_slab_alloc include/linux/kasan.h:252 [inline]
 slab_post_alloc_hook mm/slub.c:4955 [inline]
 slab_alloc_node mm/slub.c:5265 [inline]
 kmem_cache_alloc_noprof+0x250/0x6e0 mm/slub.c:5272
 vm_area_alloc+0x1f/0x160 mm/vma_init.c:32
 __mmap_new_vma mm/vma.c:2461 [inline]
 __mmap_region+0xf85/0x27a0 mm/vma.c:2670
 mmap_region+0x1ab/0x3f0 mm/vma.c:2740
 do_mmap+0xa3e/0x1210 mm/mmap.c:558
 vm_mmap_pgoff+0x29e/0x470 mm/util.c:581
 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:604
 __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/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff888035ac7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888035ac7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888035ac7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                                ^
 ffff888035ac8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888035ac8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
   0:	e9 1b ff ff ff       	jmp    0xffffff20
   5:	e8 a0 71 99 00       	call   0x9971aa
   a:	e9 49 ff ff ff       	jmp    0xffffff58
   f:	66 66 2e 0f 1f 84 00 	data16 cs nopw 0x0(%rax,%rax,1)
  16:	00 00 00 00
  1a:	90                   	nop
  1b:	90                   	nop
  1c:	90                   	nop
  1d:	90                   	nop
  1e:	90                   	nop
  1f:	90                   	nop
  20:	90                   	nop
  21:	90                   	nop
  22:	90                   	nop
  23:	90                   	nop
  24:	90                   	nop
  25:	90                   	nop
  26:	90                   	nop
  27:	90                   	nop
  28:	90                   	nop
  29:	90                   	nop
* 2a:	0f 1f 40 d6          	nopl   -0x2a(%rax) <-- trapping instruction
  2e:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  35:	fc ff df
  38:	53                   	push   %rbx
  39:	48 89 fb             	mov    %rdi,%rbx
  3c:	48                   	rex.W
  3d:	81                   	.byte 0x81
  3e:	c7                   	(bad)
  3f:	98                   	cwtl

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/13 16:01 upstream 3a8660878839 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/13 15:09 upstream 3a8660878839 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/09 05:28 upstream ec714e371f22 7e2882b3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/13 08:47 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 1c97fc901fb6 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/13 05:27 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 64b229b5b681 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/11 08:52 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 64b229b5b681 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/10 15:05 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 64b229b5b681 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/10 04:09 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a2f12b1cbec1 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/09 03:53 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a2f12b1cbec1 7e2882b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-out-of-bounds Read in mcp2221_raw_event
2025/10/13 16:22 linux-next 52ba76324a9d ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in mcp2221_raw_event
2025/10/13 11:35 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 1c97fc901fb6 b6605ba8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in mcp2221_raw_event
2025/10/12 11:34 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 64b229b5b681 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in mcp2221_raw_event
2025/10/10 02:05 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing a2f12b1cbec1 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: use-after-free Read in mcp2221_raw_event
* Struck through repros no longer work on HEAD.