projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfea9fc
)
io_uring: fix 0-iov read buffer select
author
Pavel Begunkov
<asml.silence@gmail.com>
Sat, 19 Dec 2020 03:15:43 +0000
(
03:15
+0000)
committer
Jens Axboe
<axboe@kernel.dk>
Sat, 19 Dec 2020 13:26:56 +0000
(06:26 -0700)
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>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index b74957856e6819129519aa540d5bc91686edba1e..f3690dfdd564f317e00b98308feeceef9b1bcb21 100644
(file)
--- 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