================================================================== BUG: KASAN: use-after-free in __wake_up_common+0x637/0x650 kernel/sched/wait.c:101 Read of size 8 at addr ffff88801f2c2f30 by task kworker/0:2/918 CPU: 0 PID: 918 Comm: kworker/0:2 Tainted: G W 5.17.0-syzkaller-01442-gb47d5a4f6b8d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events delayed_fput 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/0x336 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 delayed_fput+0x56/0x70 fs/file_table.c:345 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 Allocated by task 4143: 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+0x7dda/0x9310 fs/io_uring.c:7882 __do_sys_io_uring_enter+0x9f1/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 918: 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+0x126/0x160 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:215 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xd0/0x390 mm/slub.c:4562 io_clean_op+0x20a/0xd90 fs/io_uring.c:7137 io_dismantle_req fs/io_uring.c:2270 [inline] __io_req_complete_post+0x88c/0xc90 fs/io_uring.c:2108 io_req_complete_post+0x56/0x1d0 fs/io_uring.c:2121 io_apoll_task_func+0x1df/0x230 fs/io_uring.c:6003 io_fallback_req_func+0xf9/0x1ae fs/io_uring.c:1502 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 ffff88801f2c2f00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 48 bytes inside of 96-byte region [ffff88801f2c2f00, ffff88801f2c2f60) The buggy address belongs to the page: page:ffffea00007cb080 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f2c2 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001c7a040 dead000000000005 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 3645, ts 99192142801, free_ts 99189671395 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+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x27f/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0xbe1/0x12b0 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x372/0x450 mm/slub.c:4420 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_realpath_from_path+0x186/0x620 security/tomoyo/realpath.c:288 tomoyo_mount_acl+0x14e/0x840 security/tomoyo/mount.c:105 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:3296 do_mount fs/namespace.c:3367 [inline] __do_sys_mount fs/namespace.c:3575 [inline] __se_sys_mount fs/namespace.c:3552 [inline] __ia32_sys_mount+0x27e/0x300 fs/namespace.c:3552 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 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 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x6d/0x160 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:239 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x271/0x4b0 mm/slub.c:3243 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags+0x9a/0xe0 include/linux/audit.h:323 user_path_at_empty+0x2b/0x60 fs/namei.c:2850 user_path_at include/linux/namei.h:57 [inline] do_mount fs/namespace.c:3364 [inline] __do_sys_mount fs/namespace.c:3575 [inline] __se_sys_mount fs/namespace.c:3552 [inline] __ia32_sys_mount+0x1ea/0x300 fs/namespace.c:3552 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 Memory state around the buggy address: ffff88801f2c2e00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88801f2c2e80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff88801f2c2f00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88801f2c2f80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88801f2c3000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================