summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-04-29 12:46:48 +0200
committerJens Axboe <axboe@kernel.dk>2021-04-29 21:26:19 +0200
commit47b228ce6f66830768eac145efa7746637969101 (patch)
tree8d46e98b3f2a6afb937ea18cae941c97f8154cb1
parentio_uring: allow empty slots for reg buffers (diff)
downloadlinux-47b228ce6f66830768eac145efa7746637969101.tar.xz
linux-47b228ce6f66830768eac145efa7746637969101.zip
io_uring: fix unchecked error in switch_start()
io_rsrc_node_switch_start() can fail, don't forget to check returned error code. Reported-by: syzbot+a4715dd4b7c866136f79@syzkaller.appspotmail.com Fixes: eae071c9b4cef ("io_uring: prepare fixed rw for dynanic buffers") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/c4c06e2f3f0c8e43bd8d0a266c79055bcc6b6e60.1619693112.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/io_uring.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 47c2f126f885..82117e6bf45d 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -9627,7 +9627,9 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p,
if (ret)
goto err;
/* always set a rsrc node */
- io_rsrc_node_switch_start(ctx);
+ ret = io_rsrc_node_switch_start(ctx);
+ if (ret)
+ goto err;
io_rsrc_node_switch(ctx, NULL);
memset(&p->sq_off, 0, sizeof(p->sq_off));