]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring: Fix __io_uring_register() false success
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 26 May 2019 09:35:47 +0000 (12:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:09:10 +0000 (08:09 +0200)
[ Upstream commit a278682dad37fd2f8d2f30d8e84e376a856ab472 ]

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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c

index 4e32a033394cc9fe9fbe0d9014d1130a953ad208..e82adbf8adc1227043b4fcdaf026de8954783123 100644 (file)
@@ -2506,7 +2506,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