================================================================== BUG: KASAN: use-after-free in __wake_up_common+0x637/0x650 kernel/sched/wait.c:100 Read of size 8 at addr ffff88807753ce30 by task syz-executor.0/17578 CPU: 0 PID: 17578 Comm: syz-executor.0 Tainted: G W 5.17.0-syzkaller-11406-gf82da161ea75 #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 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:190 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:222 __syscall_exit_to_user_mode_work kernel/entry/common.c:304 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:315 do_syscall_64+0x42/0x80 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7face7a3bc8b 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:00007face80cfb80 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007face7a3bc8b RDX: 0000001b2cb20000 RSI: 00007face7804c18 RDI: 0000000000000003 RBP: 00007face7b9d960 R08: 0000000000000000 R09: 000000008653b91c R10: 00007fffd6fd0090 R11: 0000000000000293 R12: 00000000000ea601 R13: 00007face80cfc80 R14: 00007face80cfca0 R15: 0000000000000032 Allocated by task 17559: 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:6247 io_queue_sqe_arm_apoll+0x6d/0x430 fs/io_uring.c:7498 __io_queue_sqe fs/io_uring.c:7540 [inline] io_queue_sqe fs/io_uring.c:7567 [inline] io_submit_sqe fs/io_uring.c:7775 [inline] io_submit_sqes+0x76b0/0x95b0 fs/io_uring.c:7881 __do_sys_io_uring_enter+0x9f1/0x1520 fs/io_uring.c:10923 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 Freed by task 975: 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:10037 [inline] io_ring_ctx_free fs/io_uring.c:10063 [inline] io_ring_exit_work+0x7f7/0x1058 fs/io_uring.c:10243 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 ffff88807753ce00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 48 bytes inside of 96-byte region [ffff88807753ce00, ffff88807753ce60) The buggy address belongs to the physical page: page:ffffea0001dd4f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7753c flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00005a5300 dead000000000004 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 3625, tgid 3625 (syz-executor.4), ts 47037484785, free_ts 47028929650 prep_new_page mm/page_alloc.c:2438 [inline] get_page_from_freelist+0xba2/0x3df0 mm/page_alloc.c:4179 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5405 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] dst_cow_metrics_generic+0x48/0x1e0 net/core/dst.c:199 dst_metrics_write_ptr include/net/dst.h:119 [inline] dst_metric_set include/net/dst.h:180 [inline] icmp6_dst_alloc+0x4c0/0x680 net/ipv6/route.c:3274 ndisc_send_skb+0x113e/0x17f0 net/ipv6/ndisc.c:487 ndisc_send_rs+0x12e/0x6f0 net/ipv6/ndisc.c:717 addrconf_rs_timer+0x3f2/0x820 net/ipv6/addrconf.c:3913 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1353 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 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] __kmalloc+0x200/0x350 mm/slub.c:4410 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:714 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80 tomoyo_mount_acl+0xe5/0x840 security/tomoyo/mount.c:97 tomoyo_mount_permission+0x151/0x3f0 security/tomoyo/mount.c:237 security_sb_mount+0x66/0xc0 security/security.c:976 path_mount+0x12f/0x1fa0 fs/namespace.c:3311 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3590 [inline] __se_sys_mount fs/namespace.c:3567 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3567 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: ffff88807753cd00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88807753cd80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff88807753ce00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88807753ce80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88807753cf00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ==================================================================