================================================================== BUG: KASAN: use-after-free in ieee80211_scan_rx+0x4d0/0x510 net/mac80211/scan.c:278 Read of size 4 at addr ffff0000177b6e2c by task ksoftirqd/1/18 CPU: 1 PID: 18 Comm: ksoftirqd/1 Not tainted 5.11.0-syzkaller-11482-g8b83369ddcb3 #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:191 __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:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report+0x1ec/0x200 mm/kasan/report.c:416 __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:4627 [inline] ieee80211_rx_list+0x1334/0x1c04 net/mac80211/rx.c:4819 ieee80211_rx_napi+0xe4/0x2ec net/mac80211/rx.c:4842 ieee80211_rx include/net/mac80211.h:4524 [inline] ieee80211_tasklet_handler+0x10c/0x120 net/mac80211/main.c:235 tasklet_action_common.constprop.0+0x230/0x340 kernel/softirq.c:557 tasklet_action+0x60/0x94 kernel/softirq.c:577 _stext+0x2b4/0x1084 run_ksoftirqd kernel/softirq.c:652 [inline] run_ksoftirqd+0xa4/0xec kernel/softirq.c:644 smpboot_thread_fn+0x46c/0x7f4 kernel/smpboot.c:165 kthread+0x320/0x3bc kernel/kthread.c:292 ret_from_fork+0x10/0x3c arch/arm64/kernel/entry.S:958 Allocated by task 31293: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x60 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] __kasan_kmalloc+0x88/0xb0 mm/kasan/common.c:515 kasan_kmalloc include/linux/kasan.h:233 [inline] __kmalloc+0x25c/0x4a0 mm/slub.c:4055 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:684 [inline] cfg80211_conn_scan+0x118/0x1020 net/wireless/sme.c:80 cfg80211_sme_connect net/wireless/sme.c:585 [inline] cfg80211_connect+0x1040/0x1bb0 net/wireless/sme.c:1257 nl80211_connect+0xf94/0x1780 net/wireless/nl80211.c:10901 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/0x42c net/netlink/genetlink.c:800 netlink_rcv_skb+0x198/0x34c net/netlink/af_netlink.c:2502 genl_rcv+0x38/0x50 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x3e0/0x670 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x610/0xa20 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xc0/0xf4 net/socket.c:674 ____sys_sendmsg+0x548/0x6d0 net/socket.c:2350 ___sys_sendmsg+0xf4/0x170 net/socket.c:2404 __sys_sendmsg+0xbc/0x14c net/socket.c:2437 __do_sys_sendmsg net/socket.c:2446 [inline] __se_sys_sendmsg net/socket.c:2444 [inline] __arm64_sys_sendmsg+0x70/0xa0 net/socket.c:2444 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0xf0/0x2c0 arch/arm64/kernel/syscall.c:129 do_el0_svc+0xa4/0xd0 arch/arm64/kernel/syscall.c:168 el0_svc+0x24/0x34 arch/arm64/kernel/entry-common.c:416 el0_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:432 el0_sync+0x170/0x180 arch/arm64/kernel/entry.S:699 Freed by task 18232: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x60 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:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free+0xfc/0x160 mm/kasan/common.c:325 __kasan_slab_free+0x14/0x20 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x8c/0x240 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0x154/0x5e4 mm/slub.c:4213 ___cfg80211_scan_done+0x350/0x82c net/wireless/scan.c:974 __cfg80211_scan_done+0x30/0x50 net/wireless/scan.c:991 process_one_work+0x798/0x1764 kernel/workqueue.c:2275 worker_thread+0x3d4/0xcd0 kernel/workqueue.c:2421 kthread+0x320/0x3bc 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/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:345 insert_work+0x50/0x2a0 kernel/workqueue.c:1331 __queue_work+0x4d0/0x11a0 kernel/workqueue.c:1497 queue_work_on+0xb8/0x100 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:1652 [inline] netdev_queue_update_kobjects+0x2d4/0x3b0 net/core/net-sysfs.c:1686 register_queue_kobjects net/core/net-sysfs.c:1747 [inline] netdev_register_kobject+0x2a4/0x35c net/core/net-sysfs.c:1990 register_netdevice+0x8a0/0xf9c net/core/dev.c:10178 bond_newlink drivers/net/bonding/bond_netlink.c:458 [inline] bond_newlink+0x38/0x7c drivers/net/bonding/bond_netlink.c:448 __rtnl_newlink+0xa48/0xfe4 net/core/rtnetlink.c:3443 rtnl_newlink+0x70/0xac 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:2502 rtnetlink_rcv+0x18/0x24 net/core/rtnetlink.c:5571 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x3e0/0x670 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x610/0xa20 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xc0/0xf4 net/socket.c:674 __sys_sendto+0x16c/0x22c net/socket.c:1977 __do_sys_sendto net/socket.c:1989 [inline] __se_sys_sendto net/socket.c:1985 [inline] __arm64_sys_sendto+0xc0/0x134 net/socket.c:1985 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0xf0/0x2c0 arch/arm64/kernel/syscall.c:129 do_el0_svc+0xa4/0xd0 arch/arm64/kernel/syscall.c:168 el0_svc+0x24/0x34 arch/arm64/kernel/entry-common.c:416 el0_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:432 el0_sync+0x170/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/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:3039 [inline] call_rcu+0xb4/0x8d0 kernel/rcu/tree.c:3114 free_fib_info net/ipv4/fib_semantics.c:256 [inline] fib_create_info+0x186c/0x389c net/ipv4/fib_semantics.c:1549 fib_table_insert+0x164/0x1e10 net/ipv4/fib_trie.c:1224 fib_magic+0x2f0/0x410 net/ipv4/fib_frontend.c:1085 fib_add_ifaddr+0x144/0x3f0 net/ipv4/fib_frontend.c:1107 fib_netdev_event+0x28c/0x4b4 net/ipv4/fib_frontend.c:1466 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:2063 call_netdevice_notifiers_extack net/core/dev.c:2075 [inline] call_netdevice_notifiers net/core/dev.c:2089 [inline] __dev_notify_flags+0x144/0x1f0 net/core/dev.c:8695 dev_change_flags+0xe0/0x15c net/core/dev.c:8733 do_setlink+0x5d8/0x2840 net/core/rtnetlink.c:2708 __rtnl_newlink+0x8b8/0xfe4 net/core/rtnetlink.c:3376 rtnl_newlink+0x70/0xac 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:2502 rtnetlink_rcv+0x18/0x24 net/core/rtnetlink.c:5571 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x3e0/0x670 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x610/0xa20 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xc0/0xf4 net/socket.c:674 __sys_sendto+0x16c/0x22c net/socket.c:1977 __do_sys_sendto net/socket.c:1989 [inline] __se_sys_sendto net/socket.c:1985 [inline] __arm64_sys_sendto+0xc0/0x134 net/socket.c:1985 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0xf0/0x2c0 arch/arm64/kernel/syscall.c:129 do_el0_svc+0xa4/0xd0 arch/arm64/kernel/syscall.c:168 el0_svc+0x24/0x34 arch/arm64/kernel/entry-common.c:416 el0_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:432 el0_sync+0x170/0x180 arch/arm64/kernel/entry.S:699 The buggy address belongs to the object at ffff0000177b6e00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 44 bytes inside of 256-byte region [ffff0000177b6e00, ffff0000177b6f00) The buggy address belongs to the page: page:00000000d96e4bd2 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x577b6 head:00000000d96e4bd2 order:1 compound_mapcount:0 flags: 0x1ffc00000010200(slab|head) raw: 01ffc00000010200 fffffc0000336780 0000000500000005 ffff00000c402480 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000177b6d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000177b6d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000177b6e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000177b6e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000177b6f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================