syzbot


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

Status: upstream: reported C repro on 2024/06/13 10:59
Reported-by: syzbot+93fcbd9f3473bb064ccb@syzkaller.appspotmail.com
First crash: 6d08h, last: 6d05h
Bug presence (1)
Date Name Commit Repro Result
2024/06/13 upstream (ToT) d20f6b3d747c C Failed due to an error; will retry later
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in cfg80211_wext_freq wireless C inconclusive 120 6h37m 21d 0/27 upstream: reported C repro on 2024/05/29 09:49
linux-6.1 KASAN: slab-out-of-bounds Read in cfg80211_wext_freq 3 5d22h 10d 0/3 upstream: reported on 2024/06/09 04:12

Sample crash report:
loop0: detected capacity change from 0 to 256
exfat: Bad value for 'uid'
==================================================================
BUG: KASAN: slab-out-of-bounds in cfg80211_wext_freq+0x170/0x1ac net/wireless/wext-compat.c:235
Read of size 2 at addr ffff0000c7d8a940 by task syz-executor415/3969

CPU: 0 PID: 3969 Comm: syz-executor415 Not tainted 5.15.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x174/0x1e4 mm/kasan/report.c:451
 __asan_report_load2_noabort+0x44/0x50 mm/kasan/report_generic.c:307
 cfg80211_wext_freq+0x170/0x1ac net/wireless/wext-compat.c:235
 cfg80211_wext_siwscan+0x45c/0xe0c net/wireless/scan.c:2831
 ioctl_standard_iw_point+0x82c/0xe24 net/wireless/wext-core.c:848
 ioctl_standard_call+0xcc/0x264 net/wireless/wext-core.c:1033
 wext_ioctl_dispatch+0x16c/0x3ec net/wireless/wext-core.c:997
 wext_handle_ioctl+0x224/0x448 net/wireless/wext-core.c:1058
 sock_ioctl+0x140/0x8ac net/socket.c:1191
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 3969:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513
 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 __kmalloc+0x29c/0x4c8 mm/slub.c:4407
 kmalloc include/linux/slab.h:596 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 ioctl_standard_iw_point+0x3b8/0xe24 net/wireless/wext-core.c:809
 ioctl_standard_call+0xcc/0x264 net/wireless/wext-core.c:1033
 wext_ioctl_dispatch+0x16c/0x3ec net/wireless/wext-core.c:997
 wext_handle_ioctl+0x224/0x448 net/wireless/wext-core.c:1058
 sock_ioctl+0x140/0x8ac net/socket.c:1191
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff0000c7d8a800
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 320 bytes inside of
 512-byte region [ffff0000c7d8a800, ffff0000c7d8aa00)
The buggy address belongs to the page:
page:000000001aa7392f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107d88
head:000000001aa7392f order:2 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002600
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000c7d8a800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000c7d8a880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000c7d8a900: 00 00 00 00 00 00 00 04 fc fc fc fc fc fc fc fc
                                           ^
 ffff0000c7d8a980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000c7d8aa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
================================================================================
UBSAN: array-index-out-of-bounds in net/wireless/scan.c:2829:8
index 33 is out of range for type 'struct iw_freq[32]'
CPU: 0 PID: 3969 Comm: syz-executor415 Tainted: G    B             5.15.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 ubsan_epilogue lib/ubsan.c:151 [inline]
 __ubsan_handle_out_of_bounds+0x108/0x15c lib/ubsan.c:282
 cfg80211_wext_siwscan+0x4cc/0xe0c net/wireless/scan.c:2829
 ioctl_standard_iw_point+0x82c/0xe24 net/wireless/wext-core.c:848
 ioctl_standard_call+0xcc/0x264 net/wireless/wext-core.c:1033
 wext_ioctl_dispatch+0x16c/0x3ec net/wireless/wext-core.c:997
 wext_handle_ioctl+0x224/0x448 net/wireless/wext-core.c:1058
 sock_ioctl+0x140/0x8ac net/socket.c:1191
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
================================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/13 13:41 linux-5.15.y c61bd26ae81a 2aa5052f .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in cfg80211_wext_freq
2024/06/13 10:59 linux-5.15.y c61bd26ae81a 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in cfg80211_wext_freq
* Struck through repros no longer work on HEAD.