================================================================== BUG: KASAN: use-after-free in __wake_up_common+0x637/0x650 kernel/sched/wait.c:101 Read of size 8 at addr ffff88802489fb30 by task syz-executor.3/8200 CPU: 1 PID: 8200 Comm: syz-executor.3 Tainted: G W 5.17.0-syzkaller-01442-gb47d5a4f6b8d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x303 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __wake_up_common+0x637/0x650 kernel/sched/wait.c:101 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:138 tty_release+0x657/0x1200 drivers/tty/tty_io.c:1781 __fput+0x286/0x9f0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:189 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:221 __syscall_exit_to_user_mode_work kernel/entry/common.c:303 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:314 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fa2b69e6c8b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007fff0b5371a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00007fa2b69e6c8b RDX: 0000000000000000 RSI: 00007fa2b69ab000 RDI: 0000000000000004 RBP: 00007fa2b6b48960 R08: 0000000000000000 R09: 00000000a4424824 R10: 0000000000000000 R11: 0000000000000293 R12: 000000000002e2f6 R13: 00007fff0b5372a0 R14: 00007fff0b5372c0 R15: 0000000000000032 Allocated by task 8203: 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+0xa6/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:249 [inline] kmem_cache_alloc_trace+0x1ea/0x4a0 mm/slab.c:3567 kmalloc include/linux/slab.h:581 [inline] io_arm_poll_handler+0x39d/0x940 fs/io_uring.c:6248 io_queue_sqe_arm_apoll+0x6d/0x430 fs/io_uring.c:7499 __io_queue_sqe fs/io_uring.c:7541 [inline] io_queue_sqe fs/io_uring.c:7568 [inline] io_submit_sqe fs/io_uring.c:7776 [inline] io_submit_sqes+0x7dda/0x9310 fs/io_uring.c:7882 __do_sys_io_uring_enter+0x9f1/0x1520 fs/io_uring.c:10924 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 3694: 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+0xff/0x140 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:215 [inline] __cache_free mm/slab.c:3437 [inline] kfree+0xf8/0x2b0 mm/slab.c:3794 io_flush_apoll_cache fs/io_uring.c:10038 [inline] io_ring_ctx_free fs/io_uring.c:10064 [inline] io_ring_exit_work+0x7f7/0x1053 fs/io_uring.c:10244 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1368 __queue_work+0x5ca/0xf30 kernel/workqueue.c:1534 queue_work_on+0xee/0x110 kernel/workqueue.c:1562 queue_work include/linux/workqueue.h:502 [inline] schedule_work include/linux/workqueue.h:563 [inline] nfc_genl_rcv_nl_event net/nfc/netlink.c:1844 [inline] nfc_genl_rcv_nl_event+0x216/0x2e0 net/nfc/netlink.c:1829 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 blocking_notifier_call_chain kernel/notifier.c:319 [inline] blocking_notifier_call_chain+0x67/0x90 kernel/notifier.c:307 netlink_release+0xcb6/0x1db0 net/netlink/af_netlink.c:788 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1318 __fput+0x286/0x9f0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:189 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:221 __syscall_exit_to_user_mode_work kernel/entry/common.c:303 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:314 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3595 cfg80211_update_known_bss+0x833/0xa60 net/wireless/scan.c:1661 cfg80211_bss_update+0xef/0x2070 net/wireless/scan.c:1708 cfg80211_inform_single_bss_frame_data+0x72b/0xf30 net/wireless/scan.c:2464 cfg80211_inform_bss_frame_data+0xa7/0xb50 net/wireless/scan.c:2497 ieee80211_bss_info_update+0x35b/0xb00 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1119 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1610 [inline] ieee80211_ibss_rx_queued_mgmt+0x19cf/0x3150 net/mac80211/ibss.c:1639 ieee80211_iface_process_skb net/mac80211/iface.c:1527 [inline] ieee80211_iface_work+0xa69/0xd00 net/mac80211/iface.c:1581 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88802489fb00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 48 bytes inside of 96-byte region [ffff88802489fb00, ffff88802489fb60) The buggy address belongs to the page: page:ffffea00009227c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802489f900 pfn:0x2489f flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001f6c108 ffffea0001cda908 ffff888010c40300 raw: ffff88802489f900 ffff88802489f000 0000000100000011 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 3763, ts 55511734117, free_ts 54131262537 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 __alloc_pages_node include/linux/gfp.h:572 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x390 mm/slab.c:2584 cache_alloc_refill+0x27f/0x380 mm/slab.c:2957 ____cache_alloc mm/slab.c:3040 [inline] ____cache_alloc mm/slab.c:3023 [inline] __do_cache_alloc mm/slab.c:3267 [inline] slab_alloc mm/slab.c:3308 [inline] __do_kmalloc mm/slab.c:3692 [inline] __kmalloc_track_caller+0x3b0/0x4d0 mm/slab.c:3709 copy_array+0xc5/0xe0 kernel/bpf/verifier.c:838 copy_verifier_state+0xa3/0xb80 kernel/bpf/verifier.c:1010 push_stack+0x1d2/0x560 kernel/bpf/verifier.c:1108 check_cond_jmp_op kernel/bpf/verifier.c:9422 [inline] do_check kernel/bpf/verifier.c:11615 [inline] do_check_common+0x692f/0xcfb0 kernel/bpf/verifier.c:13697 do_check_main kernel/bpf/verifier.c:13760 [inline] bpf_check+0x9ad9/0xd540 kernel/bpf/verifier.c:14329 bpf_prog_load+0xf55/0x21e0 kernel/bpf/syscall.c:2347 __sys_bpf+0x68a/0x5970 kernel/bpf/syscall.c:4637 __do_sys_bpf kernel/bpf/syscall.c:4741 [inline] __se_sys_bpf kernel/bpf/syscall.c:4739 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4739 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 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3404 slab_destroy mm/slab.c:1630 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1650 cache_flusharray mm/slab.c:3410 [inline] ___cache_free+0x303/0x600 mm/slab.c:3472 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x50/0x1a0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:239 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slab.c:3253 [inline] kmem_cache_alloc_node+0x2ea/0x590 mm/slab.c:3591 __alloc_skb+0x215/0x340 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1158 [inline] alloc_skb_with_frags+0x93/0x620 net/core/skbuff.c:5956 sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2586 mld_newpack.isra.0+0x1be/0x750 net/ipv6/mcast.c:1746 add_grhead+0x283/0x360 net/ipv6/mcast.c:1849 add_grec+0x106a/0x1530 net/ipv6/mcast.c:1987 mld_send_initial_cr.part.0+0xf6/0x230 net/ipv6/mcast.c:2234 mld_send_initial_cr net/ipv6/mcast.c:1232 [inline] mld_dad_work+0x1d3/0x690 net/ipv6/mcast.c:2260 Memory state around the buggy address: ffff88802489fa00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff88802489fa80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88802489fb00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88802489fb80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88802489fc00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================