================================================================== BUG: KASAN: use-after-free in io_wq_worker_running+0xfe/0x130 io_uring/io-wq.c:674 Read of size 4 at addr ffff88802d462c04 by task iou-wrk-28370/28379 CPU: 1 PID: 28379 Comm: iou-wrk-28370 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+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 28370: 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 28379: 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 kvfree_call_rcu+0x118/0x8c0 kernel/rcu/tree.c:3376 ma_put net/ipv6/mcast.c:869 [inline] __ipv6_dev_mc_dec+0x39a/0x420 net/ipv6/mcast.c:982 ipv6_mc_destroy_dev+0x345/0x6b0 net/ipv6/mcast.c:2800 addrconf_ifdown+0x1740/0x1bc0 net/ipv6/addrconf.c:3893 addrconf_notify+0x3b9/0x1010 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 net/core/dev.c:1996 [inline] unregister_netdevice_many_notify+0x102e/0x1c20 net/core/dev.c:10839 sit_exit_batch_net+0x495/0x4e0 net/ipv6/sit.c:1885 ops_exit_list net/core/net_namespace.c:174 [inline] cleanup_net+0x80c/0xc60 net/core/net_namespace.c:606 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88802d462c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of 512-byte region [ffff88802d462c00, ffff88802d462e00) The buggy address belongs to the physical page: page:ffffea0000b51800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d460 head:ffffea0000b51800 order:2 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012841c80 ffffea0000730600 dead000000000002 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 5110, tgid 5110 (syz-executor.2), ts 135718431517, 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 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc+0x9e/0x190 mm/slab_common.c:981 kmalloc include/linux/slab.h:584 [inline] kzalloc include/linux/slab.h:720 [inline] new_dir fs/proc/proc_sysctl.c:971 [inline] get_subdir fs/proc/proc_sysctl.c:1015 [inline] __register_sysctl_table+0xaf7/0x1340 fs/proc/proc_sysctl.c:1366 __devinet_sysctl_register+0x1eb/0x2b0 net/ipv4/devinet.c:2587 devinet_sysctl_register+0x139/0x1a0 net/ipv4/devinet.c:2627 inetdev_init+0x28f/0x4c0 net/ipv4/devinet.c:286 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 veth_newlink+0x636/0xd10 drivers/net/veth.c:1765 page_owner free stack trace missing Memory state around the buggy address: ffff88802d462b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802d462b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802d462c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802d462c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802d462d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================