io_uring/rsrc: fix rogue rsrc node grabbing
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 29 Mar 2023 14:03:43 +0000 (15:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:51 +0000 (12:10 +0200)
commitef329fa764c3c27f43db0f7c57adbe84e9a07f00
treef6e9a10113d4187aecc9b46bbabc8b26f01e9fbc
parent3eb2138d4693d81aa6e5514f439be255117cae63
io_uring/rsrc: fix rogue rsrc node grabbing

commit 4ff0b50de8cabba055efe50bbcb7506c41a69835 upstream.

We should not be looking at ctx->rsrc_node and anyhow modifying the node
without holding uring_lock, grabbing references in such a way is not
safe either.

Cc: stable@vger.kernel.org
Fixes: 5106dd6e74ab6 ("io_uring: propagate issue_flags state down to file assignment")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/1202ede2d7bb90136e3482b2b84aad9ed483e5d6.1680098433.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/rsrc.h