================================================================== BUG: KASAN: use-after-free in io_wq_worker_running+0x114/0x130 io_uring/io-wq.c:674 Read of size 4 at addr ffff88802a739404 by task iou-wrk-6348/6363 CPU: 0 PID: 6363 Comm: iou-wrk-6348 Not tainted 6.2.0-rc2-syzkaller-00256-ga689b938df39 #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/0x461 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_preempt_disabled+0x13/0x20 kernel/sched/core.c:6690 __mutex_lock_common kernel/locking/mutex.c:679 [inline] __mutex_lock+0xa48/0x1360 kernel/locking/mutex.c:747 io_ring_submit_lock io_uring/io_uring.h:215 [inline] io_file_get_fixed io_uring/io_uring.c:1966 [inline] io_assign_file io_uring/io_uring.c:1834 [inline] io_assign_file io_uring/io_uring.c:1828 [inline] io_wq_submit_work+0x5f7/0xdc0 io_uring/io_uring.c:1916 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 6348: 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+0xa3/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 io_wqe_create_worker io_uring/io-wq.c:310 [inline] io_wqe_enqueue+0x6c3/0xbc0 io_uring/io-wq.c:936 io_queue_iowq+0x282/0x5c0 io_uring/io_uring.c:475 io_queue_sqe_fallback+0xf3/0x190 io_uring/io_uring.c:2059 io_submit_sqe io_uring/io_uring.c:2281 [inline] io_submit_sqes+0x11db/0x1e60 io_uring/io_uring.c:2397 __do_sys_io_uring_enter+0xc1d/0x2540 io_uring/io_uring.c:3345 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 6363: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:518 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] __cache_free mm/slab.c:3394 [inline] __do_kmem_cache_free mm/slab.c:3580 [inline] __kmem_cache_free+0xcd/0x3b0 mm/slab.c:3587 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_preempt_disabled+0x13/0x20 kernel/sched/core.c:6690 __mutex_lock_common kernel/locking/mutex.c:679 [inline] __mutex_lock+0xa48/0x1360 kernel/locking/mutex.c:747 io_ring_submit_lock io_uring/io_uring.h:215 [inline] io_file_get_fixed io_uring/io_uring.c:1966 [inline] io_assign_file io_uring/io_uring.c:1834 [inline] io_assign_file io_uring/io_uring.c:1828 [inline] io_wq_submit_work+0x5f7/0xdc0 io_uring/io_uring.c:1916 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+0x7b/0x90 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_preempt_disabled+0x13/0x20 kernel/sched/core.c:6690 __mutex_lock_common kernel/locking/mutex.c:679 [inline] __mutex_lock+0xa48/0x1360 kernel/locking/mutex.c:747 io_ring_submit_lock io_uring/io_uring.h:215 [inline] io_file_get_fixed io_uring/io_uring.c:1966 [inline] io_assign_file io_uring/io_uring.c:1834 [inline] io_assign_file io_uring/io_uring.c:1828 [inline] io_wq_submit_work+0x5f7/0xdc0 io_uring/io_uring.c:1916 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+0x7b/0x90 mm/kasan/generic.c:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3376 ma_put net/ipv6/mcast.c:869 [inline] ma_put+0x11c/0x180 net/ipv6/mcast.c:865 ipv6_mc_destroy_dev+0x3c4/0x630 net/ipv6/mcast.c:2810 addrconf_ifdown.isra.0+0x12c2/0x1920 net/ipv6/addrconf.c:3893 addrconf_notify+0x109/0x1c80 net/ipv6/addrconf.c:3673 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] unregister_netdevice_many_notify+0xa2b/0x19e0 net/core/dev.c:10839 ip_tunnel_delete_nets+0x3a3/0x5c0 net/ipv4/ip_tunnel.c:1126 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 setup_net+0x9bd/0xe60 net/core/net_namespace.c:356 copy_net_ns+0x31b/0x6b0 net/core/net_namespace.c:483 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x3b3/0x4a0 kernel/nsproxy.c:179 copy_process+0x30d3/0x7520 kernel/fork.c:2269 kernel_clone+0xeb/0x990 kernel/fork.c:2681 __do_sys_clone3+0x1cd/0x2e0 kernel/fork.c:2980 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88802a739400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of 512-byte region [ffff88802a739400, ffff88802a739600) The buggy address belongs to the physical page: page:ffffea0000a9ce40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a739 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012440600 ffffea0001c76010 ffffea00007b05d0 raw: 0000000000000000 ffff88802a739000 0000000100000004 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 5109, tgid 5109 (syz-executor.2), ts 118276213819, free_ts 118210839407 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_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x94/0x390 mm/slab.c:2574 cache_alloc_refill+0x27f/0x380 mm/slab.c:2947 ____cache_alloc mm/slab.c:3023 [inline] ____cache_alloc mm/slab.c:3006 [inline] __do_cache_alloc mm/slab.c:3206 [inline] slab_alloc_node mm/slab.c:3254 [inline] __kmem_cache_alloc_node+0x44f/0x510 mm/slab.c:3544 kmalloc_trace+0x26/0x60 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] device_private_init drivers/base/core.c:3323 [inline] device_add+0x116c/0x1e90 drivers/base/core.c:3373 netdev_register_kobject+0x185/0x400 net/core/net-sysfs.c:2015 register_netdevice+0xd77/0x1640 net/core/dev.c:10045 geneve_configure+0x7a5/0xc60 drivers/net/geneve.c:1432 geneve_newlink+0x12c/0x2c0 drivers/net/geneve.c:1683 rtnl_newlink_create net/core/rtnetlink.c:3407 [inline] __rtnl_newlink+0x10c2/0x1840 net/core/rtnetlink.c:3624 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3637 rtnetlink_rcv_msg+0x43e/0xca0 net/core/rtnetlink.c:6141 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 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+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 slab_destroy mm/slab.c:1619 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1639 cache_flusharray mm/slab.c:3365 [inline] ___cache_free+0x2ac/0x3d0 mm/slab.c:3428 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1a0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x63/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/slab.c:3261 [inline] __kmem_cache_alloc_node+0x26b/0x510 mm/slab.c:3544 kmalloc_trace+0x26/0x60 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] kset_create lib/kobject.c:944 [inline] kset_create_and_add+0x4f/0x1a0 lib/kobject.c:987 register_queue_kobjects net/core/net-sysfs.c:1766 [inline] netdev_register_kobject+0x1ca/0x400 net/core/net-sysfs.c:2019 register_netdevice+0xd77/0x1640 net/core/dev.c:10045 geneve_configure+0x7a5/0xc60 drivers/net/geneve.c:1432 geneve_newlink+0x12c/0x2c0 drivers/net/geneve.c:1683 rtnl_newlink_create net/core/rtnetlink.c:3407 [inline] __rtnl_newlink+0x10c2/0x1840 net/core/rtnetlink.c:3624 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3637 Memory state around the buggy address: ffff88802a739300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802a739380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802a739400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802a739480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802a739500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================