================================================================== BUG: KASAN: use-after-free in __wake_up_common+0x637/0x650 kernel/sched/wait.c:100 Read of size 8 at addr ffff888022149c30 by task syz-executor.2/4510 CPU: 1 PID: 4510 Comm: syz-executor.2 Tainted: G W 5.17.0-syzkaller-13673-ge8b767f5e040 #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+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 __wake_up_common+0x637/0x650 kernel/sched/wait.c:100 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:137 tty_release+0x657/0x1200 drivers/tty/tty_io.c:1781 __fput+0x277/0x9d0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:37 [inline] do_exit+0xaff/0x2a00 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x22df/0x24c0 kernel/signal.c:2904 arch_do_signal_or_restart+0x88/0x1a10 arch/x86/kernel/signal.c:867 exit_to_user_mode_loop kernel/entry/common.c:180 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:215 __syscall_exit_to_user_mode_work kernel/entry/common.c:297 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:308 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7f87549 Code: Unable to access opcode bytes at RIP 0xf7f8751f. RSP: 002b:00000000f7f8267c EFLAGS: 00000296 ORIG_RAX: 00000000000000f0 RAX: fffffffffffffe00 RBX: 00000000f6f5afa8 RCX: 0000000000000080 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000f6f5afac RBP: 0000000000000081 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4491: 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: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+0x76b0/0x95b0 fs/io_uring.c:7882 __do_sys_io_uring_enter+0xa14/0x1520 fs/io_uring.c:10924 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 11: 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 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/0x1058 fs/io_uring.c:10244 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 cfg80211_update_known_bss+0x833/0xa60 net/wireless/scan.c:1668 cfg80211_bss_update+0xef/0x2070 net/wireless/scan.c:1715 cfg80211_inform_single_bss_frame_data+0x731/0xf40 net/wireless/scan.c:2471 cfg80211_inform_bss_frame_data+0xa7/0xb50 net/wireless/scan.c:2504 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+0x1a74/0x33b0 net/mac80211/ibss.c:1639 ieee80211_iface_process_skb net/mac80211/iface.c:1527 [inline] ieee80211_iface_work+0xa6f/0xd10 net/mac80211/iface.c:1581 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 Second to 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 cfg80211_update_known_bss+0x833/0xa60 net/wireless/scan.c:1668 cfg80211_bss_update+0xef/0x2070 net/wireless/scan.c:1715 cfg80211_inform_single_bss_frame_data+0x731/0xf40 net/wireless/scan.c:2471 cfg80211_inform_bss_frame_data+0xa7/0xb50 net/wireless/scan.c:2504 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+0x1a74/0x33b0 net/mac80211/ibss.c:1639 ieee80211_iface_process_skb net/mac80211/iface.c:1527 [inline] ieee80211_iface_work+0xa6f/0xd10 net/mac80211/iface.c:1581 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 ffff888022149c00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 48 bytes inside of 96-byte region [ffff888022149c00, ffff888022149c60) The buggy address belongs to the physical page: page:ffffea0000885240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22149 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888010c41780 raw: 0000000000000000 0000000000200020 00000001ffffffff 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3664, tgid 3664 (kworker/0:5), ts 108432084872, free_ts 108420535701 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3df0 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2262 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] slab_alloc mm/slub.c:3225 [inline] kmem_cache_alloc_trace+0x310/0x3f0 mm/slub.c:3256 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] nsim_fib6_rt_create drivers/net/netdevsim/fib.c:544 [inline] nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:749 [inline] nsim_fib6_event drivers/net/netdevsim/fib.c:853 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:886 [inline] nsim_fib_event_work+0x1115/0x2710 drivers/net/netdevsim/fib.c:1477 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 process_scheduled_works kernel/workqueue.c:2352 [inline] worker_thread+0x854/0x1080 kernel/workqueue.c:2438 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 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/0x690 mm/page_alloc.c:3423 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2523 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_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3242 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags+0x9a/0xe0 include/linux/audit.h:323 vfs_fstatat+0x73/0xb0 fs/stat.c:254 __do_sys_newfstatat+0x91/0x110 fs/stat.c:426 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888022149b00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888022149b80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff888022149c00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888022149c80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888022149d00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ==================================================================