mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
io_uring: fix 32-bit compatability with sendmsg/recvmsg
commit d876836204897b6d7d911f942084f69a1e9d5c4d upstream. 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. Cc: stable@vger.kernel.org Fixes:aa1fa28fc7("io_uring: add support for recvmsg()") Fixes:0fa03c624d("io_uring: add support for sendmsg()") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9629f47d7d
commit
7eaf718b83
1 changed files with 5 additions and 0 deletions
|
|
@ -1657,6 +1657,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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue