[1/1] io_uring: Fix __io_uring_register() false success
diff mbox series

Message ID f9e0372fd0e52ca276bb307da1271908cab4efb4.1558862678.git.asml.silence@gmail.com
State New
Headers show
Series
  • [1/1] io_uring: Fix __io_uring_register() false success
Related show

Commit Message

Pavel Begunkov May 26, 2019, 9:35 a.m. UTC
From: Pavel Begunkov <asml.silence@gmail.com>

If io_copy_iov() fails, it will break the loop and report success,
albeit partially completed operation.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe May 26, 2019, 3:25 p.m. UTC | #1
On 5/26/19 3:35 AM, Pavel Begunkov (Silence) wrote:
> From: Pavel Begunkov <asml.silence@gmail.com>
> 
> If io_copy_iov() fails, it will break the loop and report success,
> albeit partially completed operation.

Thanks, applied.

Patch
diff mbox series

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 310f8d17c53e..0fbb486a320e 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2616,7 +2616,7 @@  static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
 
 		ret = io_copy_iov(ctx, &iov, arg, i);
 		if (ret)
-			break;
+			goto err;
 
 		/*
 		 * Don't impose further limits on the size and buffer