This is a note to let you know that I've just added the patch titled io_uring/msg_ring: fix remote queue to disabled ring to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-msg_ring-fix-remote-queue-to-disabled-ring.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 8579538c89e33ce78be2feb41e07489c8cbf8f31 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov <asml.silence@xxxxxxxxx> Date: Fri, 20 Jan 2023 16:38:06 +0000 Subject: io_uring/msg_ring: fix remote queue to disabled ring From: Pavel Begunkov <asml.silence@xxxxxxxxx> commit 8579538c89e33ce78be2feb41e07489c8cbf8f31 upstream. IORING_SETUP_R_DISABLED rings don't have the submitter task set, so it's not always safe to use ->submitter_task. Disallow posting msg_ring messaged to disabled rings. Also add task NULL check for loosy sync around testing for IORING_SETUP_R_DISABLED. Cc: stable@xxxxxxxxxxxxxxx Fixes: 6d043ee1164ca ("io_uring: do msg_ring in target task via tw") Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- io_uring/msg_ring.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/io_uring/msg_ring.c +++ b/io_uring/msg_ring.c @@ -30,6 +30,8 @@ static int io_msg_ring_data(struct io_ki if (msg->src_fd || msg->dst_fd || msg->flags) return -EINVAL; + if (target_ctx->flags & IORING_SETUP_R_DISABLED) + return -EBADFD; if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0, true)) return 0; @@ -84,6 +86,8 @@ static int io_msg_send_fd(struct io_kioc if (target_ctx == ctx) return -EINVAL; + if (target_ctx->flags & IORING_SETUP_R_DISABLED) + return -EBADFD; ret = io_double_lock_ctx(ctx, target_ctx, issue_flags); if (unlikely(ret)) Patches currently in stable-queue which might be from asml.silence@xxxxxxxxx are queue-6.1/io_uring-msg_ring-fix-remote-queue-to-disabled-ring.patch