================================================================== BUG: KASAN: use-after-free in ieee80211_scan_rx+0x4d0/0x510 net/mac80211/scan.c:278 Read of size 4 at addr ffff000016850c2c by task ksoftirqd/1/18 CPU: 1 PID: 18 Comm: ksoftirqd/1 Not tainted 5.11.0-syzkaller #0 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x3e0 arch/arm64/include/asm/pointer_auth.h:76 show_stack+0x18/0x70 arch/arm64/kernel/stacktrace.c:196 __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x110/0x188 lib/dump_stack.c:120 print_address_description.constprop.0+0x2c/0x300 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report+0x1e8/0x200 mm/kasan/report.c:413 __asan_report_load4_noabort+0x34/0x60 mm/kasan/report_generic.c:308 ieee80211_scan_rx+0x4d0/0x510 net/mac80211/scan.c:278 __ieee80211_rx_handle_packet net/mac80211/rx.c:4558 [inline] ieee80211_rx_list+0x133c/0x1930 net/mac80211/rx.c:4746 ieee80211_rx_napi+0xe4/0x2e4 net/mac80211/rx.c:4769 ieee80211_rx include/net/mac80211.h:4508 [inline] ieee80211_tasklet_handler+0x10c/0x120 net/mac80211/main.c:235 tasklet_action_common.constprop.0+0x230/0x340 kernel/softirq.c:555 tasklet_action+0x60/0x94 kernel/softirq.c:575 _stext+0x400/0x10cc run_ksoftirqd kernel/softirq.c:650 [inline] run_ksoftirqd+0xa4/0xec kernel/softirq.c:642 smpboot_thread_fn+0x46c/0x7f4 kernel/smpboot.c:165 kthread+0x320/0x3c0 kernel/kthread.c:292 ret_from_fork+0x10/0x3c arch/arm64/kernel/entry.S:958 Allocated by task 12650: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x8c/0xb4 mm/kasan/common.c:429 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:443 kasan_kmalloc include/linux/kasan.h:219 [inline] __kmalloc+0x264/0x4b0 mm/slub.c:3985 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:682 [inline] cfg80211_conn_scan+0x11c/0x1074 net/wireless/sme.c:81 cfg80211_sme_connect net/wireless/sme.c:586 [inline] cfg80211_connect+0x104c/0x1bf0 net/wireless/sme.c:1258 nl80211_connect+0xf6c/0x1740 net/wireless/nl80211.c:10759 genl_family_rcv_msg_doit+0x1b8/0x2a0 net/netlink/genetlink.c:739 genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x24c/0x430 net/netlink/genetlink.c:800 netlink_rcv_skb+0x198/0x34c net/netlink/af_netlink.c:2494 genl_rcv+0x38/0x50 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x3e0/0x670 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x610/0xa20 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xc0/0xf4 net/socket.c:672 ____sys_sendmsg+0x548/0x6d0 net/socket.c:2345 ___sys_sendmsg+0xf4/0x170 net/socket.c:2399 __sys_sendmsg+0xbc/0x14c net/socket.c:2432 __do_sys_sendmsg net/socket.c:2441 [inline] __se_sys_sendmsg net/socket.c:2439 [inline] __arm64_sys_sendmsg+0x70/0xa0 net/socket.c:2439 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0x110/0x3c0 arch/arm64/kernel/syscall.c:159 do_el0_svc+0xa4/0xd0 arch/arm64/kernel/syscall.c:198 el0_svc+0x20/0x30 arch/arm64/kernel/entry-common.c:365 el0_sync_handler+0x1a4/0x1ac arch/arm64/kernel/entry-common.c:381 el0_sync+0x174/0x180 arch/arm64/kernel/entry.S:699 Freed by task 7562: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_set_track+0x28/0x40 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x50 mm/kasan/generic.c:356 ____kasan_slab_free+0xf0/0x154 mm/kasan/common.c:362 __kasan_slab_free+0x14/0x20 mm/kasan/common.c:369 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x8c/0x240 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kfree+0x154/0x5fc mm/slub.c:4139 ___cfg80211_scan_done+0x330/0x81c net/wireless/scan.c:974 __cfg80211_scan_done+0x24/0x40 net/wireless/scan.c:991 process_one_work+0x79c/0x1880 kernel/workqueue.c:2275 worker_thread+0x3d4/0xcd0 kernel/workqueue.c:2421 kthread+0x320/0x3c0 kernel/kthread.c:292 ret_from_fork+0x10/0x3c arch/arm64/kernel/entry.S:958 Last potentially related work creation: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:344 insert_work+0x50/0x2a0 kernel/workqueue.c:1331 __queue_work+0x4d4/0x11b4 kernel/workqueue.c:1497 queue_work_on+0xb8/0xfc kernel/workqueue.c:1524 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x268/0x430 kernel/umh.c:433 kobject_uevent_env+0xaf8/0x10d0 lib/kobject_uevent.c:617 kobject_uevent+0x14/0x20 lib/kobject_uevent.c:641 netdev_queue_add_kobject net/core/net-sysfs.c:1605 [inline] netdev_queue_update_kobjects+0x2d4/0x3b0 net/core/net-sysfs.c:1639 register_queue_kobjects net/core/net-sysfs.c:1700 [inline] netdev_register_kobject+0x2a4/0x35c net/core/net-sysfs.c:1943 register_netdevice+0x85c/0x111c net/core/dev.c:10058 ipvlan_link_new+0x2ac/0x8fc drivers/net/ipvlan/ipvlan_main.c:586 __rtnl_newlink+0xaac/0xfc0 net/core/rtnetlink.c:3443 rtnl_newlink+0x70/0xb0 net/core/rtnetlink.c:3491 rtnetlink_rcv_msg+0x300/0x744 net/core/rtnetlink.c:5553 netlink_rcv_skb+0x198/0x34c net/netlink/af_netlink.c:2494 rtnetlink_rcv+0x18/0x24 net/core/rtnetlink.c:5571 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x3e0/0x670 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x610/0xa20 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xc0/0xf4 net/socket.c:672 __sys_sendto+0x16c/0x22c net/socket.c:1975 __do_sys_sendto net/socket.c:1987 [inline] __se_sys_sendto net/socket.c:1983 [inline] __arm64_sys_sendto+0xc0/0x134 net/socket.c:1983 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0x110/0x3c0 arch/arm64/kernel/syscall.c:159 do_el0_svc+0xa4/0xd0 arch/arm64/kernel/syscall.c:198 el0_svc+0x20/0x30 arch/arm64/kernel/entry-common.c:365 el0_sync_handler+0x1a4/0x1ac arch/arm64/kernel/entry-common.c:381 el0_sync+0x174/0x180 arch/arm64/kernel/entry.S:699 Second to last potentially related work creation: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:344 __call_rcu kernel/rcu/tree.c:2965 [inline] call_rcu+0xf4/0x5f0 kernel/rcu/tree.c:3038 free_fib_info net/ipv4/fib_semantics.c:256 [inline] fib_info_put include/net/ip_fib.h:531 [inline] fib_release_info+0x484/0x7a0 net/ipv4/fib_semantics.c:277 fib_table_flush+0x3ac/0x890 net/ipv4/fib_trie.c:2040 fib_flush+0x84/0x100 net/ipv4/fib_frontend.c:194 fib_disable_ip net/ipv4/fib_frontend.c:1406 [inline] fib_netdev_event+0x358/0x4b4 net/ipv4/fib_frontend.c:1496 notifier_call_chain+0xc0/0x180 kernel/notifier.c:83 raw_notifier_call_chain+0x18/0x24 kernel/notifier.c:410 call_netdevice_notifiers_info+0x84/0xec net/core/dev.c:2040 call_netdevice_notifiers_extack net/core/dev.c:2052 [inline] call_netdevice_notifiers net/core/dev.c:2066 [inline] dev_close_many+0x238/0x430 net/core/dev.c:1641 rollback_registered_many+0x2f4/0x10b0 net/core/dev.c:9473 unregister_netdevice_many.part.0+0x20/0x280 net/core/dev.c:10736 unregister_netdevice_many net/core/dev.c:10735 [inline] default_device_exit_batch+0x23c/0x2e0 net/core/dev.c:11219 ops_exit_list+0xd0/0x124 net/core/net_namespace.c:190 cleanup_net+0x3a4/0x820 net/core/net_namespace.c:604 process_one_work+0x79c/0x1880 kernel/workqueue.c:2275 worker_thread+0x3d4/0xcd0 kernel/workqueue.c:2421 kthread+0x320/0x3c0 kernel/kthread.c:292 ret_from_fork+0x10/0x3c arch/arm64/kernel/entry.S:958 The buggy address belongs to the object at ffff000016850c00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 44 bytes inside of 256-byte region [ffff000016850c00, ffff000016850d00) The buggy address belongs to the page: page:00000000c26802c8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x56850 head:00000000c26802c8 order:1 compound_mapcount:0 flags: 0x1ffc00000010200(slab|head) raw: 01ffc00000010200 fffffc0000406a00 0000000b0000000b ffff00000cc03b00 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff000016850b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff000016850b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff000016850c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff000016850c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff000016850d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================