syzbot


KASAN: use-after-free Read in ieee80211_scan_rx (3)
Status: upstream: reported on 2022/04/26 06:10
Reported-by: syzbot+f9acff9bf08a845f225d@syzkaller.appspotmail.com
First crash: 36d, last: 12d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ieee80211_scan_rx 8 451d 595d 0/22 auto-closed as invalid on 2021/06/29 23:53
upstream KASAN: use-after-free Read in ieee80211_scan_rx (2) 2 242d 301d 0/22 auto-closed as invalid on 2022/01/24 23:00

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ieee80211_scan_rx+0x7d0/0x7e0 net/mac80211/scan.c:293
Read of size 4 at addr ffff88807e88e02c by task ksoftirqd/1/21

CPU: 1 PID: 21 Comm: ksoftirqd/1 Not tainted 5.18.0-rc6-syzkaller-00153-g2fe1020d73ca #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313
 print_report mm/kasan/report.c:429 [inline]
 kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491
 ieee80211_scan_rx+0x7d0/0x7e0 net/mac80211/scan.c:293
 __ieee80211_rx_handle_packet net/mac80211/rx.c:4781 [inline]
 ieee80211_rx_list+0x1fe3/0x2740 net/mac80211/rx.c:4974
 ieee80211_rx_napi+0xdb/0x3d0 net/mac80211/rx.c:4997
 ieee80211_rx include/net/mac80211.h:4611 [inline]
 ieee80211_tasklet_handler+0xd4/0x130 net/mac80211/main.c:235
 tasklet_action_common.constprop.0+0x201/0x2e0 kernel/softirq.c:784
 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
 run_ksoftirqd kernel/softirq.c:921 [inline]
 run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913
 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>

Allocated by task 30901:
 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:436 [inline]
 ____kasan_kmalloc mm/kasan/common.c:515 [inline]
 ____kasan_kmalloc mm/kasan/common.c:474 [inline]
 __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524
 kmalloc include/linux/slab.h:586 [inline]
 kzalloc include/linux/slab.h:714 [inline]
 nl80211_trigger_scan+0x42f/0x1ce0 net/wireless/nl80211.c:8620
 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731
 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
 genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:705 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:725
 ____sys_sendmsg+0x6e2/0x800 net/socket.c:2413
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 4693:
 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
 kasan_set_track+0x21/0x30 mm/kasan/common.c:45
 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
 ____kasan_slab_free mm/kasan/common.c:366 [inline]
 ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328
 kasan_slab_free include/linux/kasan.h:200 [inline]
 slab_free_hook mm/slub.c:1728 [inline]
 slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754
 slab_free mm/slub.c:3510 [inline]
 kfree+0xd6/0x4d0 mm/slub.c:4552
 ___cfg80211_scan_done+0x482/0x970 net/wireless/scan.c:991
 __cfg80211_scan_done+0x2c/0x40 net/wireless/scan.c:1008
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

Last potentially related work creation:
 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348
 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3595
 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1705
 unregister_sysctl_table fs/proc/proc_sysctl.c:1743 [inline]
 unregister_sysctl_table+0xc0/0x190 fs/proc/proc_sysctl.c:1718
 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7081 [inline]
 addrconf_sysctl_unregister+0xee/0x1c0 net/ipv6/addrconf.c:7109
 addrconf_ifdown.isra.0+0x12e5/0x16b0 net/ipv6/addrconf.c:3885
 addrconf_notify+0xeb/0x1ba0 net/ipv6/addrconf.c:3662
 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84
 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1938
 call_netdevice_notifiers_extack net/core/dev.c:1976 [inline]
 call_netdevice_notifiers net/core/dev.c:1990 [inline]
 unregister_netdevice_many+0x92e/0x1890 net/core/dev.c:10747
 default_device_exit_batch+0x449/0x590 net/core/dev.c:11241
 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167
 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

The buggy address belongs to the object at ffff88807e88e000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 44 bytes inside of
 2048-byte region [ffff88807e88e000, ffff88807e88e800)

The buggy address belongs to the physical page:
page:ffffea0001fa2200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e888
head:ffffea0001fa2200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888010c42000
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 30515, tgid 30515 (syz-executor.3), ts 1119823684499, free_ts 1119806711039
 prep_new_page mm/page_alloc.c:2441 [inline]
 get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182
 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408
 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272
 alloc_slab_page mm/slub.c:1799 [inline]
 allocate_slab+0x26c/0x3c0 mm/slub.c:1944
 new_slab mm/slub.c:2004 [inline]
 ___slab_alloc+0x8df/0xf20 mm/slub.c:3005
 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092
 slab_alloc_node mm/slub.c:3183 [inline]
 __kmalloc_node_track_caller+0x2cb/0x360 mm/slub.c:4947
 kmalloc_reserve net/core/skbuff.c:354 [inline]
 pskb_expand_head+0x15e/0x1070 net/core/skbuff.c:1700
 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1301
 netlink_broadcast+0x5b/0xd60 net/netlink/af_netlink.c:1497
 nlmsg_multicast include/net/netlink.h:1033 [inline]
 nlmsg_notify+0x8f/0x280 net/netlink/af_netlink.c:2545
 rtnl_notify net/core/rtnetlink.c:730 [inline]
 rtmsg_ifinfo_send net/core/rtnetlink.c:3868 [inline]
 rtmsg_ifinfo_event net/core/rtnetlink.c:3883 [inline]
 rtmsg_ifinfo_event net/core/rtnetlink.c:3871 [inline]
 rtmsg_ifinfo+0xf0/0x120 net/core/rtnetlink.c:3889
 __dev_notify_flags+0x226/0x2b0 net/core/dev.c:8467
 rtnl_configure_link+0x16b/0x240 net/core/rtnetlink.c:3162
 __rtnl_newlink+0x10b1/0x1760 net/core/rtnetlink.c:3491
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3531
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1356 [inline]
 free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406
 free_unref_page_prepare mm/page_alloc.c:3328 [inline]
 free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423
 qlink_free mm/kasan/quarantine.c:157 [inline]
 qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446
 kasan_slab_alloc include/linux/kasan.h:224 [inline]
 slab_post_alloc_hook mm/slab.h:749 [inline]
 slab_alloc_node mm/slub.c:3217 [inline]
 slab_alloc mm/slub.c:3225 [inline]
 kmem_cache_alloc_trace+0x26d/0x3f0 mm/slub.c:3256
 kmalloc include/linux/slab.h:581 [inline]
 kzalloc include/linux/slab.h:714 [inline]
 ref_tracker_alloc+0x14c/0x550 lib/ref_tracker.c:85
 __netdev_tracker_alloc include/linux/netdevice.h:3924 [inline]
 dev_hold_track include/linux/netdevice.h:3953 [inline]
 dev_hold_track include/linux/netdevice.h:3948 [inline]
 netdev_queue_add_kobject net/core/net-sysfs.c:1650 [inline]
 netdev_queue_update_kobjects+0x1a7/0x4e0 net/core/net-sysfs.c:1705
 register_queue_kobjects net/core/net-sysfs.c:1766 [inline]
 netdev_register_kobject+0x35a/0x430 net/core/net-sysfs.c:2012
 register_netdevice+0xd9d/0x15b0 net/core/dev.c:9961
 team_newlink+0x8e/0x150 drivers/net/team/team.c:2195
 __rtnl_newlink+0x107f/0x1760 net/core/rtnetlink.c:3483
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3531
 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5993
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345

Memory state around the buggy address:
 ffff88807e88df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88807e88df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807e88e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff88807e88e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807e88e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/05/15 01:41 upstream 2fe1020d73ca 744a39e2 .config log report info KASAN: use-after-free Read in ieee80211_scan_rx
ci-qemu-upstream 2022/04/25 20:39 upstream af2d861d4cd2 152baedd .config log report info KASAN: use-after-free Read in ieee80211_scan_rx
ci-upstream-kasan-gce-selinux-root 2022/04/21 16:16 upstream b253435746d9 2738b391 .config log report info KASAN: use-after-free Read in ieee80211_scan_rx