================================================================== BUG: KASAN: use-after-free in io_wq_worker_running+0x114/0x130 io_uring/io-wq.c:674 Read of size 4 at addr ffff88801ce66c04 by task iou-wrk-8125/8144 CPU: 1 PID: 8144 Comm: iou-wrk-8125 Not tainted 6.2.0-rc3-syzkaller-00030-ge8f60cd7db24 #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+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 io_wq_worker_running+0x114/0x130 io_uring/io-wq.c:674 schedule_timeout+0x1e1/0x2a0 kernel/time/timer.c:2143 wait_woken+0x197/0x200 kernel/sched/wait.c:463 sk_wait_data+0x378/0x450 net/core/sock.c:2971 tcp_recvmsg_locked+0x9b0/0x22b0 net/ipv4/tcp.c:2564 tcp_recvmsg+0x117/0x620 net/ipv4/tcp.c:2679 inet_recvmsg+0x114/0x5e0 net/ipv4/af_inet.c:861 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] sock_read_iter+0x348/0x480 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+0x323/0x1420 io_uring/rw.c:766 io_issue_sqe+0x156/0x1220 io_uring/io_uring.c:1856 io_wq_submit_work+0x29c/0xdc0 io_uring/io_uring.c:1932 io_worker_handle_work+0xc41/0x1c60 io_uring/io-wq.c:587 io_wqe_worker+0xa5b/0xe40 io_uring/io-wq.c:632 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 8125: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/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+0x10c/0x630 io_uring/io-wq.c:801 create_worker_cb+0x1fb/0x270 io_uring/io-wq.c:339 task_work_run+0x16f/0x270 kernel/task_work.c:179 get_signal+0x1c7/0x2450 kernel/signal.c:2635 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 8144: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:518 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0xaf/0x3b0 mm/slub.c:3800 io_wq_cancel_tw_create io_uring/io-wq.c:1233 [inline] io_queue_worker_create+0x567/0x660 io_uring/io-wq.c:381 io_wqe_dec_running+0x1e4/0x240 io_uring/io-wq.c:410 io_wq_worker_sleeping+0xa6/0xc0 io_uring/io-wq.c:698 sched_submit_work kernel/sched/core.c:6597 [inline] schedule+0x16e/0x1b0 kernel/sched/core.c:6628 schedule_timeout+0x1e1/0x2a0 kernel/time/timer.c:2143 wait_woken+0x197/0x200 kernel/sched/wait.c:463 sk_wait_data+0x378/0x450 net/core/sock.c:2971 tcp_recvmsg_locked+0x9b0/0x22b0 net/ipv4/tcp.c:2564 tcp_recvmsg+0x117/0x620 net/ipv4/tcp.c:2679 inet_recvmsg+0x114/0x5e0 net/ipv4/af_inet.c:861 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] sock_read_iter+0x348/0x480 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+0x323/0x1420 io_uring/rw.c:766 io_issue_sqe+0x156/0x1220 io_uring/io_uring.c:1856 io_wq_submit_work+0x29c/0xdc0 io_uring/io_uring.c:1932 io_worker_handle_work+0xc41/0x1c60 io_uring/io-wq.c:587 io_wqe_worker+0xa5b/0xe40 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+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 task_work_add+0x7f/0x2c0 kernel/task_work.c:48 io_queue_worker_create+0x41d/0x660 io_uring/io-wq.c:373 io_wqe_dec_running+0x1e4/0x240 io_uring/io-wq.c:410 io_wq_worker_sleeping+0xa6/0xc0 io_uring/io-wq.c:698 sched_submit_work kernel/sched/core.c:6597 [inline] schedule+0x16e/0x1b0 kernel/sched/core.c:6628 schedule_timeout+0x1e1/0x2a0 kernel/time/timer.c:2143 wait_woken+0x197/0x200 kernel/sched/wait.c:463 sk_wait_data+0x378/0x450 net/core/sock.c:2971 tcp_recvmsg_locked+0x9b0/0x22b0 net/ipv4/tcp.c:2564 tcp_recvmsg+0x117/0x620 net/ipv4/tcp.c:2679 inet_recvmsg+0x114/0x5e0 net/ipv4/af_inet.c:861 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] sock_read_iter+0x348/0x480 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+0x323/0x1420 io_uring/rw.c:766 io_issue_sqe+0x156/0x1220 io_uring/io_uring.c:1856 io_wq_submit_work+0x29c/0xdc0 io_uring/io_uring.c:1932 io_worker_handle_work+0xc41/0x1c60 io_uring/io-wq.c:587 io_wqe_worker+0xa5b/0xe40 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+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x693/0x13b0 kernel/workqueue.c:1517 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1700 expire_timers+0xbb/0x5c0 kernel/time/timer.c:1746 __run_timers kernel/time/timer.c:2022 [inline] __run_timers kernel/time/timer.c:1995 [inline] run_timer_softirq+0x326/0x910 kernel/time/timer.c:2035 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 The buggy address belongs to the object at ffff88801ce66c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of 512-byte region [ffff88801ce66c00, ffff88801ce66e00) The buggy address belongs to the physical page: page:ffffea0000739900 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ce64 head:ffffea0000739900 order:2 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 anon flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012441c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 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 5122, tgid 5122 (syz-executor.0), ts 288704297289, free_ts 151694503920 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2286 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x1a4/0x430 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] mca_alloc net/ipv6/mcast.c:880 [inline] __ipv6_dev_mc_inc+0x3de/0xec0 net/ipv6/mcast.c:936 ipv6_add_dev+0xafc/0x1320 net/ipv6/addrconf.c:462 addrconf_notify+0x85c/0x1c80 net/ipv6/addrconf.c:3528 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] register_netdevice+0xfb4/0x1640 net/core/dev.c:10078 cfg80211_register_netdevice+0x157/0x330 net/wireless/core.c:1397 ieee80211_if_add+0x1073/0x1960 net/mac80211/iface.c:2196 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3464 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2637 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x1e4/0x430 mm/slub.c:3476 ptlock_alloc+0x21/0x70 mm/memory.c:5843 ptlock_init include/linux/mm.h:2466 [inline] pgtable_pte_page_ctor include/linux/mm.h:2493 [inline] __pte_alloc_one include/asm-generic/pgalloc.h:66 [inline] pte_alloc_one+0x6c/0x230 arch/x86/mm/pgtable.c:33 __pte_alloc+0x6d/0x260 mm/memory.c:421 do_anonymous_page mm/memory.c:4042 [inline] handle_pte_fault mm/memory.c:4929 [inline] __handle_mm_fault+0x38cf/0x3c90 mm/memory.c:5073 handle_mm_fault+0x1b6/0x850 mm/memory.c:5219 do_user_addr_fault+0x475/0x1210 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 Memory state around the buggy address: ffff88801ce66b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801ce66b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801ce66c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801ce66c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801ce66d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================