================================================================== BUG: KASAN: use-after-free in ieee80211_scan_rx+0x749/0x780 net/mac80211/scan.c:269 Read of size 4 at addr ffff8880163e182c by task ksoftirqd/3/27 CPU: 3 PID: 27 Comm: ksoftirqd/3 Not tainted 5.9.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x198/0x1fd lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 ieee80211_scan_rx+0x749/0x780 net/mac80211/scan.c:269 __ieee80211_rx_handle_packet net/mac80211/rx.c:4591 [inline] ieee80211_rx_list+0x1ea2/0x23a0 net/mac80211/rx.c:4779 ieee80211_rx_napi+0xf7/0x3d0 net/mac80211/rx.c:4800 ieee80211_rx include/net/mac80211.h:4435 [inline] ieee80211_tasklet_handler+0xd3/0x130 net/mac80211/main.c:235 tasklet_action_common.constprop.0+0x237/0x470 kernel/softirq.c:559 __do_softirq+0x1f8/0xb23 kernel/softirq.c:298 run_ksoftirqd kernel/softirq.c:652 [inline] run_ksoftirqd+0xcf/0x170 kernel/softirq.c:644 smpboot_thread_fn+0x655/0x9e0 kernel/smpboot.c:165 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 29238: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 __do_kmalloc mm/slab.c:3659 [inline] __kmalloc+0x1b0/0x360 mm/slab.c:3668 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:666 [inline] nl80211_trigger_scan+0x425/0x20a0 net/wireless/nl80211.c:7827 genl_family_rcv_msg_doit net/netlink/genetlink.c:669 [inline] genl_family_rcv_msg net/netlink/genetlink.c:714 [inline] genl_rcv_msg+0x61d/0x980 net/netlink/genetlink.c:731 netlink_rcv_skb+0x15a/0x430 net/netlink/af_netlink.c:2470 genl_rcv+0x24/0x40 net/netlink/genetlink.c:742 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353 ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x60/0x90 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 11514: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3422 [inline] kfree+0x10e/0x2b0 mm/slab.c:3760 ___cfg80211_scan_done+0x2ae/0x5f0 net/wireless/scan.c:505 __cfg80211_scan_done+0x1f/0x30 net/wireless/scan.c:521 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff8880163e1800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 44 bytes inside of 1024-byte region [ffff8880163e1800, ffff8880163e1c00) The buggy address belongs to the page: page:000000001218fd4f refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880163e1000 pfn:0x163e1 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00009d1a88 ffffea0000876e88 ffff88802c840700 raw: ffff8880163e1000 ffff8880163e1000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880163e1700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880163e1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880163e1800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880163e1880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880163e1900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================