FAILED: patch "[PATCH] io_uring: fix 32-bit compatability with sendmsg/recvmsg" failed to apply to 5.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From d876836204897b6d7d911f942084f69a1e9d5c4d Mon Sep 17 00:00:00 2001
From: Jens Axboe <[email protected]>
Date: Thu, 27 Feb 2020 14:17:49 -0700
Subject: [PATCH] io_uring: fix 32-bit compatability with sendmsg/recvmsg
We must set MSG_CMSG_COMPAT if we're in compatability mode, otherwise the iovec import for these commands will not do the right thing and fail the command with -EINVAL.
Found by running the test suite compiled as 32-bit.
fs/io_uring.c +10 -0
@@ -3001,6 +3001,11 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) sr->msg =u64_to_user_ptr (READ_ONCE (sqe->addr)); sr->len =READ_ONCE (sqe->len); +#ifdef CONFIG_COMPAT +if (req->ctx->compat) + sr->msg_flags |=MSG_CMSG_COMPAT ; +#endif +if (!io || req->opcode ==IORING_OP_SEND )return 0 ;/* iovec is already imported */
@@ -3153,6 +3158,11 @@ static int io_recvmsg_prep(struct io_kiocb *req, sr->msg =u64_to_user_ptr (READ_ONCE (sqe->addr)); sr->len =READ_ONCE (sqe->len); +#ifdef CONFIG_COMPAT +if (req->ctx->compat) + sr->msg_flags |=MSG_CMSG_COMPAT ; +#endif +if (!io || req->opcode ==IORING_OP_RECV )return 0 ;/* iovec is already imported */
Quoted 5 lines · On 3/2/20 11:13 AM, [email protected] wrote:
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Here's a 5.4 version.
commit d876836204897b6d7d911f942084f69a1e9d5c4d
Author: Jens Axboe <[email protected]> Date: Thu Feb 27 14:17:49 2020 -0700
io_uring: fix 32-bit compatability with sendmsg/recvmsg
We must set MSG_CMSG_COMPAT if we're in compatability mode, otherwise the iovec import for these commands will not do the right thing and fail the command with -EINVAL.
Found by running the test suite compiled as 32-bit.
fs/io_uring.c +5 -0
@@ -1666,6 +1666,11 @@ static int io_send_recvmsg(struct io_kiocb *req, const struct io_uring_sqe *sqe,else if (force_nonblock) flags |=MSG_DONTWAIT ; +#ifdef CONFIG_COMPAT +if (req->ctx->compat) + flags |=MSG_CMSG_COMPAT ; +#endif + msg = (struct user_msghdr __user *) (unsigned long )READ_ONCE (sqe->addr);
Signature · 1 line
Jens Axboe
Greg KH
maintainerQuoted 8 lines · Jens Axboe
Quoted 5 lines · On 3/2/20 11:13 AM, [email protected] wrote:
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.Here's a 5.4 version.
Thanks for this and the 5.5 version, both now queued up.
greg k-h