]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring: clean rings on NO_MMAP alloc fail
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 12 Mar 2024 14:56:27 +0000 (14:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:31 +0000 (15:28 +0200)
commit1241052e158d8088faee46ceb5879c74af0b4943
treeffabbd66d374a93373708f9658211e689bf924b2
parente8fc78a1c70fe82b32420e5632ade2937942a3f9
io_uring: clean rings on NO_MMAP alloc fail

[ Upstream commit cef59d1ea7170ec753182302645a0191c8aa3382 ]

We make a few cancellation judgements based on ctx->rings, so let's
zero it afer deallocation for IORING_SETUP_NO_MMAP just like it's
done with the mmap case. Likely, it's not a real problem, but zeroing
is safer and better tested.

Cc: stable@vger.kernel.org
Fixes: 03d89a2de25bbc ("io_uring: support for user allocated memory for rings/sqes")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9ff6cdf91429b8a51699c210e1f6af6ea3f8bdcf.1710255382.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/io_uring.c