loop4: detected capacity change from 0 to 512 ================================================================== BUG: KASAN: slab-out-of-bounds in cfg80211_wext_freq+0x170/0x1ac net/wireless/wext-compat.c:235 Read of size 2 at addr ffff0000e3b79d40 by task syz.4.441/6335 CPU: 1 PID: 6335 Comm: syz.4.441 Not tainted 5.15.162-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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 6335: 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 ffff0000e3b79c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 320 bytes inside of 512-byte region [ffff0000e3b79c00, ffff0000e3b79e00) The buggy address belongs to the page: page:00000000d49a1de7 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x123b78 head:00000000d49a1de7 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0002600 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e3b79c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000e3b79c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000e3b79d00: 00 00 00 00 00 00 00 04 fc fc fc fc fc fc fc fc ^ ffff0000e3b79d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000e3b79e00: 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: 1 PID: 6335 Comm: syz.4.441 Tainted: G B 5.15.162-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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 ================================================================================