================================================================== BUG: KASAN: use-after-free in io_wq_worker_running+0xfe/0x130 io_uring/io-wq.c:674 Read of size 4 at addr ffff88801d757404 by task iou-wrk-16394/16397 CPU: 1 PID: 16397 Comm: iou-wrk-16394 Not tainted 6.2.0-rc2-syzkaller-00313-g9b43a525db12 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:306 print_report+0x107/0x220 mm/kasan/report.c:417 kasan_report+0x139/0x170 mm/kasan/report.c:517 io_wq_worker_running+0xfe/0x130 io_uring/io-wq.c:674 schedule_timeout+0xac/0x300 kernel/time/timer.c:2143 wait_woken+0xca/0x1b0 kernel/sched/wait.c:463 af_alg_wait_for_data+0x458/0x700 crypto/af_alg.c:904 _skcipher_recvmsg crypto/algif_skcipher.c:65 [inline] skcipher_recvmsg+0x2d9/0xea0 crypto/algif_skcipher.c:157 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_read_iter+0x3fa/0x530 net/socket.c:1086 call_read_iter include/linux/fs.h:2183 [inline] io_iter_do_read io_uring/rw.c:643 [inline] io_read+0x4a8/0x1310 io_uring/rw.c:766 io_issue_sqe+0x44e/0xcd0 io_uring/io_uring.c:1856 io_wq_submit_work+0x44a/0x9c0 io_uring/io_uring.c:1932 io_worker_handle_work+0x8e1/0xee0 io_uring/io-wq.c:587 io_wqe_worker+0x36c/0xde0 io_uring/io-wq.c:632 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 16394: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380 kmalloc_node include/linux/slab.h:606 [inline] kzalloc_node include/linux/slab.h:731 [inline] create_io_worker+0xef/0x630 io_uring/io-wq.c:801 create_worker_cb+0x16b/0x330 io_uring/io-wq.c:339 task_work_run+0x243/0x300 kernel/task_work.c:179 get_signal+0x1654/0x1820 kernel/signal.c:2635 arch_do_signal_or_restart+0x8d/0x5f0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 16397: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:518 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x71/0x110 mm/slub.c:3800 io_wq_cancel_tw_create+0x77/0xd0 io_uring/io-wq.c:1233 io_queue_worker_create+0x384/0x430 io_uring/io-wq.c:381 sched_submit_work kernel/sched/core.c:6597 [inline] schedule+0x63/0x190 kernel/sched/core.c:6628 schedule_timeout+0xac/0x300 kernel/time/timer.c:2143 wait_woken+0xca/0x1b0 kernel/sched/wait.c:463 af_alg_wait_for_data+0x458/0x700 crypto/af_alg.c:904 _skcipher_recvmsg crypto/algif_skcipher.c:65 [inline] skcipher_recvmsg+0x2d9/0xea0 crypto/algif_skcipher.c:157 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_read_iter+0x3fa/0x530 net/socket.c:1086 call_read_iter include/linux/fs.h:2183 [inline] io_iter_do_read io_uring/rw.c:643 [inline] io_read+0x4a8/0x1310 io_uring/rw.c:766 io_issue_sqe+0x44e/0xcd0 io_uring/io_uring.c:1856 io_wq_submit_work+0x44a/0x9c0 io_uring/io_uring.c:1932 io_worker_handle_work+0x8e1/0xee0 io_uring/io-wq.c:587 io_wqe_worker+0x36c/0xde0 io_uring/io-wq.c:632 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:488 task_work_add+0x87/0x340 kernel/task_work.c:48 io_queue_worker_create+0x1e2/0x430 io_uring/io-wq.c:373 sched_submit_work kernel/sched/core.c:6597 [inline] schedule+0x63/0x190 kernel/sched/core.c:6628 schedule_timeout+0xac/0x300 kernel/time/timer.c:2143 wait_woken+0xca/0x1b0 kernel/sched/wait.c:463 af_alg_wait_for_data+0x458/0x700 crypto/af_alg.c:904 _skcipher_recvmsg crypto/algif_skcipher.c:65 [inline] skcipher_recvmsg+0x2d9/0xea0 crypto/algif_skcipher.c:157 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_read_iter+0x3fa/0x530 net/socket.c:1086 call_read_iter include/linux/fs.h:2183 [inline] io_iter_do_read io_uring/rw.c:643 [inline] io_read+0x4a8/0x1310 io_uring/rw.c:766 io_issue_sqe+0x44e/0xcd0 io_uring/io_uring.c:1856 io_wq_submit_work+0x44a/0x9c0 io_uring/io_uring.c:1932 io_worker_handle_work+0x8e1/0xee0 io_uring/io-wq.c:587 io_wqe_worker+0x36c/0xde0 io_uring/io-wq.c:632 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:488 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0xaaa/0xd60 kernel/workqueue.c:1517 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x7a2/0x990 kernel/time/timer.c:2022 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:2035 __do_softirq+0x277/0x75b kernel/softirq.c:571 The buggy address belongs to the object at ffff88801d757400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of 512-byte region [ffff88801d757400, ffff88801d757600) The buggy address belongs to the physical page: page:ffffea000075d500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d754 head:ffffea000075d500 order:2 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012841c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 553, tgid 553 (kworker/u4:0), ts 5683917865, free_ts 0 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0xbd/0x190 mm/slub.c:1851 allocate_slab+0x5e/0x3c0 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0x7f4/0xeb0 mm/slub.c:3193 __slab_alloc mm/slub.c:3292 [inline] __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x25b/0x340 mm/slub.c:3491 kmalloc_trace+0x26/0x60 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] alloc_bprm+0x56/0x3b0 fs/exec.c:1510 kernel_execve+0x97/0xa00 fs/exec.c:1981 call_usermodehelper_exec_async+0x262/0x3b0 kernel/umh.c:113 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 page_owner free stack trace missing Memory state around the buggy address: ffff88801d757300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801d757380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801d757400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801d757480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801d757500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================