================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:72 [inline] BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:147 [inline] BUG: KASAN: use-after-free in __refcount_add_not_zero include/linux/refcount.h:152 [inline] BUG: KASAN: use-after-free in __refcount_inc_not_zero include/linux/refcount.h:227 [inline] BUG: KASAN: use-after-free in refcount_inc_not_zero include/linux/refcount.h:245 [inline] BUG: KASAN: use-after-free in io_worker_get io_uring/io-wq.c:153 [inline] BUG: KASAN: use-after-free in io_wq_for_each_worker io_uring/io-wq.c:846 [inline] BUG: KASAN: use-after-free in io_wq_exit_workers io_uring/io-wq.c:1250 [inline] BUG: KASAN: use-after-free in io_wq_put_and_exit+0x584/0xe30 io_uring/io-wq.c:1289 Read of size 4 at addr ffff888020705000 by task syz-executor.5/10859 CPU: 1 PID: 10859 Comm: syz-executor.5 Not tainted 6.2.0-rc3-syzkaller-00021-g7dd4b804e080 #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 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:72 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] refcount_read include/linux/refcount.h:147 [inline] __refcount_add_not_zero include/linux/refcount.h:152 [inline] __refcount_inc_not_zero include/linux/refcount.h:227 [inline] refcount_inc_not_zero include/linux/refcount.h:245 [inline] io_worker_get io_uring/io-wq.c:153 [inline] io_wq_for_each_worker io_uring/io-wq.c:846 [inline] io_wq_exit_workers io_uring/io-wq.c:1250 [inline] io_wq_put_and_exit+0x584/0xe30 io_uring/io-wq.c:1289 io_uring_clean_tctx+0x117/0x178 io_uring/tctx.c:193 io_uring_cancel_generic+0x5ae/0x606 io_uring/io_uring.c:3145 io_uring_files_cancel include/linux/io_uring.h:55 [inline] do_exit+0x522/0x2950 kernel/exit.c:822 do_group_exit+0xd4/0x2a0 kernel/exit.c:1012 get_signal+0x21c3/0x2450 kernel/signal.c:2859 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 RIP: 0033:0x7f806628c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8066f51168 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: 0000000000000300 RBX: 00007f80663ac050 RCX: 00007f806628c0c9 RDX: 0000000000000000 RSI: 0000000000000300 RDI: 0000000000000005 RBP: 00007f80662e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcb93bf2ff R14: 00007f8066f51300 R15: 0000000000022000 Allocated by task 10859: 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 10859: 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_wq_exit_workers io_uring/io-wq.c:1244 [inline] io_wq_put_and_exit+0x120/0xe30 io_uring/io-wq.c:1289 io_uring_clean_tctx+0x117/0x178 io_uring/tctx.c:193 io_uring_cancel_generic+0x5ae/0x606 io_uring/io_uring.c:3145 io_uring_files_cancel include/linux/io_uring.h:55 [inline] do_exit+0x522/0x2950 kernel/exit.c:822 do_group_exit+0xd4/0x2a0 kernel/exit.c:1012 get_signal+0x21c3/0x2450 kernel/signal.c:2859 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 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 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2755 sctp_endpoint_destroy net/sctp/endpointola.c:228 [inline] sctp_endpoint_put+0x193/0x200 net/sctp/endpointola.c:243 sctp_destroy_sock+0xa6/0x3e0 net/sctp/socket.c:5095 sk_common_release+0x68/0x390 net/core/sock.c:3671 sctp_close+0x4dc/0x940 net/sctp/socket.c:1548 inet_release+0x132/0x270 net/ipv4/af_inet.c:428 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:489 __sock_release net/socket.c:650 [inline] sock_release+0x8b/0x1b0 net/socket.c:678 inet_ctl_sock_destroy include/net/inet_common.h:71 [inline] sctp_ctrlsock_exit+0x66/0x80 net/sctp/protocol.c:1477 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169 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_clone+0xba/0x100 kernel/fork.c:2822 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 ffff888020705000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff888020705000, ffff888020705200) The buggy address belongs to the physical page: page:ffffea000081c140 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20705 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012440600 ffffea0001336210 ffffea0000a202d0 raw: 0000000000000000 ffff888020705000 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 0x2c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 5090, tgid 5090 (syz-executor.3), ts 153173538972, free_ts 153088805955 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 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:988 kmalloc_reserve net/core/skbuff.c:492 [inline] __alloc_skb+0xe9/0x310 net/core/skbuff.c:565 alloc_skb include/linux/skbuff.h:1270 [inline] nlmsg_new include/net/netlink.h:1002 [inline] netlink_ack+0x184/0x1370 net/netlink/af_netlink.c:2501 netlink_rcv_skb+0x34f/0x440 net/netlink/af_netlink.c:2570 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 __sys_sendto+0x23a/0x340 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xe1/0x1b0 net/socket.c:2125 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 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+0x297/0x590 mm/slab.c:3532 __alloc_skb+0x216/0x310 net/core/skbuff.c:552 alloc_skb include/linux/skbuff.h:1270 [inline] alloc_skb_with_frags+0x97/0x6c0 net/core/skbuff.c:6195 sock_alloc_send_pskb+0x7a7/0x930 net/core/sock.c:2741 sock_alloc_send_skb include/net/sock.h:1888 [inline] mld_newpack.isra.0+0x1b9/0x770 net/ipv6/mcast.c:1748 add_grhead+0x295/0x340 net/ipv6/mcast.c:1851 add_grec+0x1082/0x1560 net/ipv6/mcast.c:1989 mld_send_initial_cr.part.0+0xf6/0x230 net/ipv6/mcast.c:2236 mld_send_initial_cr net/ipv6/mcast.c:1232 [inline] mld_dad_work+0x1d7/0x680 net/ipv6/mcast.c:2262 Memory state around the buggy address: ffff888020704f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020704f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888020705000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020705080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020705100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================