================================================================== BUG: KASAN: use-after-free in io_wq_worker_running+0xfe/0x130 io_uring/io-wq.c:674 Read of size 4 at addr ffff88804aa4a004 by task iou-wrk-19257/19281 CPU: 0 PID: 19281 Comm: iou-wrk-19257 Not tainted 6.2.0-rc3-syzkaller-00060-gc757fc92a3f7 #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 sctp_wait_for_sndbuf+0x649/0x950 net/sctp/socket.c:9210 sctp_sendmsg_to_asoc+0x735/0xf10 net/sctp/socket.c:1829 sctp_sendmsg+0x180d/0x2550 net/sctp/socket.c:2025 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xc1/0xf0 net/socket.c:734 io_send+0x51a/0x1310 io_uring/net.c:392 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 19257: 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 19281: 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 sctp_wait_for_sndbuf+0x649/0x950 net/sctp/socket.c:9210 sctp_sendmsg_to_asoc+0x735/0xf10 net/sctp/socket.c:1829 sctp_sendmsg+0x180d/0x2550 net/sctp/socket.c:2025 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xc1/0xf0 net/socket.c:734 io_send+0x51a/0x1310 io_uring/net.c:392 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 sctp_wait_for_sndbuf+0x649/0x950 net/sctp/socket.c:9210 sctp_sendmsg_to_asoc+0x735/0xf10 net/sctp/socket.c:1829 sctp_sendmsg+0x180d/0x2550 net/sctp/socket.c:2025 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xc1/0xf0 net/socket.c:734 io_send+0x51a/0x1310 io_uring/net.c:392 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 ffff88804aa4a000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of 512-byte region [ffff88804aa4a000, ffff88804aa4a200) The buggy address belongs to the physical page: page:ffffea00012a9200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4aa48 head:ffffea00012a9200 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 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 5097, tgid 5097 (syz-executor.1), ts 160602126391, free_ts 11661265412 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] inetdev_init+0x81/0x4c0 net/ipv4/devinet.c:269 inetdev_event+0x282/0x1470 net/ipv4/devinet.c:1535 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1944 [inline] call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers+0x14e/0x1d0 net/core/dev.c:1996 register_netdevice+0x15e4/0x1a30 net/core/dev.c:10078 rtnl_newlink_create net/core/rtnetlink.c:3409 [inline] __rtnl_newlink net/core/rtnetlink.c:3624 [inline] rtnl_newlink+0x178a/0x20a0 net/core/rtnetlink.c:3637 rtnetlink_rcv_msg+0x7ca/0xec0 net/core/rtnetlink.c:6141 netlink_rcv_skb+0x1f0/0x470 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x7e7/0x9c0 net/netlink/af_netlink.c:1356 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+0x751/0x780 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x19/0x4c0 mm/page_alloc.c:3464 free_contig_range+0xa3/0x160 mm/page_alloc.c:9485 destroy_args+0xfe/0x990 mm/debug_vm_pgtable.c:998 debug_vm_pgtable+0x453/0x4b0 mm/debug_vm_pgtable.c:1318 do_one_initcall+0xbd/0x2c0 init/main.c:1306 do_initcall_level+0x168/0x220 init/main.c:1379 do_initcalls+0x43/0x90 init/main.c:1395 kernel_init_freeable+0x471/0x620 init/main.c:1634 kernel_init+0x19/0x2b0 init/main.c:1522 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff88804aa49f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804aa49f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804aa4a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804aa4a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804aa4a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================