From: Pavel Begunkov asml.silence@gmail.com
mainline inclusion from mainline-5.2-rc3 commit a278682dad37fd2f8d2f30d8e84e376a856ab472 category: feature bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27 CVE: NA ---------------------------
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: Zhihao Cheng chengzhihao1@huawei.com Signed-off-by: yangerkun yangerkun@huawei.com Reviewed-by: zhangyi (F) yi.zhang@huawei.com Signed-off-by: Cheng Jian cj.chengjian@huawei.com --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c index 62a73623601d..3229b34e0fe0 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2609,7 +2609,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