aboutsummaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-12-19 03:15:43 +0000
committerJens Axboe <axboe@kernel.dk>2020-12-19 06:26:56 -0700
commitdd20166236953c8cd14f4c668bf972af32f0c6be (patch)
tree2a3bb69cd6643ca9ec0b92681ae1512c85cd5d7e /fs/io_uring.c
parentio_uring: close a small race gap for files cancel (diff)
downloadlinux-dev-dd20166236953c8cd14f4c668bf972af32f0c6be.tar.xz
linux-dev-dd20166236953c8cd14f4c668bf972af32f0c6be.zip
io_uring: fix 0-iov read buffer select
Doing vectored buf-select read with 0 iovec passed is meaningless and utterly broken, forbid it. Cc: <stable@vger.kernel.org> # 5.7+ Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index b74957856e68..f3690dfdd564 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3125,9 +3125,7 @@ static ssize_t io_iov_buffer_select(struct io_kiocb *req, struct iovec *iov,
iov[0].iov_len = kbuf->len;
return 0;
}
- if (!req->rw.len)
- return 0;
- else if (req->rw.len > 1)
+ if (req->rw.len != 1)
return -EINVAL;
#ifdef CONFIG_COMPAT