Skip to content

Commit 47b228c

Browse files
isilenceaxboe
authored andcommitted
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: eae071c ("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>
1 parent 6224843 commit 47b228c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fs/io_uring.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9627,7 +9627,9 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p,
96279627
if (ret)
96289628
goto err;
96299629
/* always set a rsrc node */
9630-
io_rsrc_node_switch_start(ctx);
9630+
ret = io_rsrc_node_switch_start(ctx);
9631+
if (ret)
9632+
goto err;
96319633
io_rsrc_node_switch(ctx, NULL);
96329634

96339635
memset(&p->sq_off, 0, sizeof(p->sq_off));

0 commit comments

Comments
 (0)