================================================================== BUG: KASAN: slab-out-of-bounds in cfg80211_wext_freq+0x170/0x1ac net/wireless/wext-compat.c:235 Read of size 2 at addr ffff0000e5fdcd40 by task syz.4.4623/15299 CPU: 0 PID: 15299 Comm: syz.4.4623 Not tainted 5.15.163-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 15299: 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 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 kvfree_call_rcu+0xb8/0x684 kernel/rcu/tree.c:3596 drop_sysctl_table+0x274/0x3a0 fs/proc/proc_sysctl.c:1680 drop_sysctl_table+0x284/0x3a0 fs/proc/proc_sysctl.c:1683 unregister_sysctl_table+0x94/0x130 fs/proc/proc_sysctl.c:1718 unregister_net_sysctl_table+0x20/0x30 net/sysctl_net.c:175 neigh_sysctl_unregister+0x78/0x9c net/core/neighbour.c:3732 devinet_sysctl_unregister net/ipv4/devinet.c:2642 [inline] inetdev_destroy net/ipv4/devinet.c:324 [inline] inetdev_event+0x57c/0x1234 net/ipv4/devinet.c:1598 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers net/core/dev.c:2044 [inline] unregister_netdevice_many+0xec4/0x189c net/core/dev.c:11094 default_device_exit_batch+0x4c0/0x520 net/core/dev.c:11627 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x5e0/0x9bc net/core/net_namespace.c:599 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Second to last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3087 fib6_info_release include/net/ip6_fib.h:339 [inline] fib6_del_route net/ipv6/ip6_fib.c:1998 [inline] fib6_del+0xdc0/0x1234 net/ipv6/ip6_fib.c:2031 fib6_clean_node+0x24c/0x4d0 net/ipv6/ip6_fib.c:2193 fib6_walk_continue+0x5b8/0x7e0 net/ipv6/ip6_fib.c:2115 fib6_walk+0x144/0x258 net/ipv6/ip6_fib.c:2163 fib6_clean_tree net/ipv6/ip6_fib.c:2243 [inline] __fib6_clean_all+0x2a4/0x428 net/ipv6/ip6_fib.c:2259 fib6_clean_all+0x3c/0x50 net/ipv6/ip6_fib.c:2270 rt6_sync_down_dev net/ipv6/route.c:4919 [inline] rt6_disable_ip+0x5e8/0x6ac net/ipv6/route.c:4924 addrconf_ifdown+0x150/0x1814 net/ipv6/addrconf.c:3777 addrconf_notify+0x350/0xc58 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers net/core/dev.c:2044 [inline] dev_close_many+0x2fc/0x468 net/core/dev.c:1619 dev_close+0x174/0x250 net/core/dev.c:1641 cfg80211_shutdown_all_interfaces+0xc0/0x1d8 net/wireless/core.c:275 ieee80211_remove_interfaces+0x15c/0x624 net/mac80211/iface.c:2124 ieee80211_unregister_hw+0x5c/0x1ec net/mac80211/main.c:1390 mac80211_hwsim_del_radio+0x21c/0x3d8 drivers/net/wireless/mac80211_hwsim.c:3473 hwsim_exit_net+0x518/0x5e0 drivers/net/wireless/mac80211_hwsim.c:4243 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x568/0x9bc net/core/net_namespace.c:599 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 The buggy address belongs to the object at ffff0000e5fdcc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 320 bytes inside of 512-byte region [ffff0000e5fdcc00, ffff0000e5fdce00) The buggy address belongs to the page: page:00000000804d92e6 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x125fdc head:00000000804d92e6 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: ffff0000e5fdcc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000e5fdcc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000e5fdcd00: 00 00 00 00 00 00 00 04 fc fc fc fc fc fc fc fc ^ ffff0000e5fdcd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000e5fdce00: 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: 15299 Comm: syz.4.4623 Tainted: G B 5.15.163-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 ================================================================================