public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: fix 0-iov read buffer select
@ 2020-12-19  3:15 Pavel Begunkov
  2020-12-19 13:27 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2020-12-19  3:15 UTC (permalink / raw)
  To: Jens Axboe, io-uring; +Cc: stable

Doing vectored buf-select read with 0 iovec passed is meaningless and
utterly broken, forbid it.

Cc: <[email protected]> # 5.7+
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 4 +---
 1 file changed, 1 insertion(+), 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
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] io_uring: fix 0-iov read buffer select
  2020-12-19  3:15 [PATCH] io_uring: fix 0-iov read buffer select Pavel Begunkov
@ 2020-12-19 13:27 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-12-19 13:27 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring; +Cc: stable

On 12/18/20 8:15 PM, Pavel Begunkov wrote:
> Doing vectored buf-select read with 0 iovec passed is meaningless and
> utterly broken, forbid it.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-19 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-19  3:15 [PATCH] io_uring: fix 0-iov read buffer select Pavel Begunkov
2020-12-19 13:27 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox