diff options
| author | Jens Axboe <axboe@kernel.dk> | 2022-06-30 14:38:45 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-07 17:54:52 +0200 |
| commit | 02a591474e8fae92e648bf5989b99183ef76c289 (patch) | |
| tree | b133445ca09a4dad71bcc94c3c74d7cc96b26e11 /fs | |
| parent | 694e548b54076111a6e368422885d2d5ee0b5265 (diff) | |
| download | linux-02a591474e8fae92e648bf5989b99183ef76c289.tar.gz linux-02a591474e8fae92e648bf5989b99183ef76c289.tar.bz2 linux-02a591474e8fae92e648bf5989b99183ef76c289.zip | |
io_uring: ensure that send/sendmsg and recv/recvmsg check sqe->ioprio
commit 73911426aaaadbae54fa72359b33a7b6a56947db upstream.
All other opcodes correctly check if this is set and -EINVAL if it is
and they don't support that field, for some reason the these were
forgotten.
This was unified a bit differently in the upstream tree, but had the
same effect as making sure we error on this field. Rather than have
a painful backport of the upstream commit, just fixup the mentioned
opcodes.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/io_uring.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 7c190e885340..7e8c715052c0 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5254,7 +5254,7 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) return -EINVAL; - if (unlikely(sqe->addr2 || sqe->file_index)) + if (unlikely(sqe->addr2 || sqe->file_index || sqe->ioprio)) return -EINVAL; sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); @@ -5467,7 +5467,7 @@ static int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) return -EINVAL; - if (unlikely(sqe->addr2 || sqe->file_index)) + if (unlikely(sqe->addr2 || sqe->file_index || sqe->ioprio)) return -EINVAL; sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); |
