syzbot


KASAN: slab-out-of-bounds Read in cfg80211_connect

Status: closed as invalid on 2025/04/08 14:38
Subsystems: wireless
[Documentation on labels]
First crash: 204d, last: 204d

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in cfg80211_sme_get_conn_ies net/wireless/sme.c:534 [inline]
BUG: KASAN: slab-out-of-bounds in cfg80211_sme_connect net/wireless/sme.c:589 [inline]
BUG: KASAN: slab-out-of-bounds in cfg80211_connect+0xf21/0x1d10 net/wireless/sme.c:1527
Read of size 235 at addr ffff888027189580 by task syz.2.871/8972

CPU: 0 UID: 0 PID: 8972 Comm: syz.2.871 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:489
 kasan_report+0x143/0x180 mm/kasan/report.c:602
 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189
 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105
 cfg80211_sme_get_conn_ies net/wireless/sme.c:534 [inline]
 cfg80211_sme_connect net/wireless/sme.c:589 [inline]
 cfg80211_connect+0xf21/0x1d10 net/wireless/sme.c:1527
 cfg80211_mgd_wext_connect+0x470/0x5d0 net/wireless/wext-sme.c:57
 cfg80211_wext_siwessid+0xc0/0x130 net/wireless/wext-compat.c:1483
 ioctl_standard_iw_point+0x789/0xcb0 net/wireless/wext-core.c:867
 ioctl_standard_call+0xbd/0x190 net/wireless/wext-core.c:1052
 wext_ioctl_dispatch+0x14f/0x530 net/wireless/wext-core.c:1016
 wext_handle_ioctl+0x166/0x280 net/wireless/wext-core.c:1077
 sock_ioctl+0x17c/0x8e0 net/socket.c:1262
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f75a838cd29
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:00007f75a9233038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f75a85a5fa0 RCX: 00007f75a838cd29
RDX: 0000000020000000 RSI: 0000000000008b1a RDI: 0000000000000003
RBP: 00007f75a840e2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f75a85a5fa0 R15: 00007ffd47672e48
 </TASK>

Allocated by task 8695:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __do_kmalloc_node mm/slub.c:4298 [inline]
 __kmalloc_node_track_caller_noprof+0x28b/0x4c0 mm/slub.c:4317
 kmemdup_noprof+0x2a/0x60 mm/util.c:135
 cfg80211_wext_siwgenie+0x1a2/0x320 net/wireless/wext-sme.c:323
 ioctl_standard_iw_point+0x789/0xcb0 net/wireless/wext-core.c:867
 ioctl_standard_call+0xbd/0x190 net/wireless/wext-core.c:1052
 wext_ioctl_dispatch+0x14f/0x530 net/wireless/wext-core.c:1016
 wext_handle_ioctl+0x166/0x280 net/wireless/wext-core.c:1077
 sock_ioctl+0x17c/0x8e0 net/socket.c:1262
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff888027189580
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 0 bytes inside of
 allocated 35-byte region [ffff888027189580, ffff8880271895a3)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27189
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88801ac418c0 ffffea0000a0f980 dead000000000004
raw: 0000000000000000 0000000000200020 00000001f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 1, tgid 1 (swapper/0), ts 7812392420, free_ts 7790795699
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558
 prep_new_page mm/page_alloc.c:1566 [inline]
 get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476
 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753
 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
 alloc_slab_page+0x59/0x110 mm/slub.c:2425
 allocate_slab+0x5a/0x2b0 mm/slub.c:2589
 new_slab mm/slub.c:2642 [inline]
 ___slab_alloc+0xc27/0x14a0 mm/slub.c:3830
 __slab_alloc+0x58/0xa0 mm/slub.c:3920
 __slab_alloc_node mm/slub.c:3995 [inline]
 slab_alloc_node mm/slub.c:4156 [inline]
 __do_kmalloc_node mm/slub.c:4297 [inline]
 __kmalloc_node_noprof+0x2ee/0x4d0 mm/slub.c:4304
 kmalloc_node_noprof include/linux/slab.h:928 [inline]
 expand_xps_map net/core/dev.c:2587 [inline]
 __netif_set_xps_queue+0x6c8/0x1e40 net/core/dev.c:2689
 virtnet_set_affinity+0x4d3/0x620 drivers/net/virtio_net.c:3855
 init_vqs+0x10c3/0x1210 drivers/net/virtio_net.c:6432
 virtnet_probe+0x1bfa/0x3c80 drivers/net/virtio_net.c:6812
 virtio_dev_probe+0x931/0xc80 drivers/virtio/virtio.c:341
 really_probe+0x2b8/0xad0 drivers/base/dd.c:658
 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800
 driver_probe_device+0x50/0x430 drivers/base/dd.c:830
page last free pid 974 tgid 974 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1127 [inline]
 free_unref_page+0xd3f/0x1010 mm/page_alloc.c:2659
 vfree+0x1c3/0x360 mm/vmalloc.c:3383
 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:3303
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
 worker_thread+0x870/0xd30 kernel/workqueue.c:3398
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Memory state around the buggy address:
 ffff888027189480: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff888027189500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
>ffff888027189580: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc
                               ^
 ffff888027189600: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff888027189680: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/28 08:52 bpf c45323b7560e 18070896 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: slab-out-of-bounds Read in cfg80211_connect
* Struck through repros no longer work on HEAD.