]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/msg_ring: don't leave potentially dangling ->tctx pointer
authorJens Axboe <axboe@kernel.dk>
Thu, 23 Jan 2025 00:03:28 +0000 (17:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Feb 2025 09:02:17 +0000 (10:02 +0100)
commit0184d8a3b94fc24262f08cd4165e7a02864b365c
tree22a700b5b64ddad7e19169c98639b10bdcbda51b
parent4eed8bd68aa370a1d7a2f58aedb225a6c3a06921
io_uring/msg_ring: don't leave potentially dangling ->tctx pointer

[ Upstream commit 69a62e03f896a7382671877b6ad6aab87c53e9c3 ]

For remote posting of messages, req->tctx is assigned even though it
is never used. Rather than leave a dangling pointer, just clear it to
NULL and use the previous check for a valid submitter_task to gate on
whether or not the request should be terminated.

Reported-by: Jann Horn <jannh@google.com>
Fixes: b6f58a3f4aa8 ("io_uring: move struct io_kiocb from task_struct to io_uring_task")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/msg_ring.c