io_uring: fix races with file table unregister
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 13 Jun 2022 05:32:44 +0000 (06:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:22:00 +0000 (14:22 +0200)
commitb1e7cade3cafc593905f9ed81e7f6db3034eee1d
treeea220b6ecc226658c8174df1f4f56ad710c07597
parentd460a8a3b980f4de28eaf347ca01520847612a5c
io_uring: fix races with file table unregister

[ Upstream commit b0380bf6dad4601d92025841e2b7a135d566c6e3 ]

Fixed file table quiesce might unlock ->uring_lock, potentially letting
new requests to be submitted, don't allow those requests to use the
table as they will race with unregistration.

Reported-and-tested-by: van fantasy <g1042620637@gmail.com>
Fixes: 05f3fb3c53975 ("io_uring: avoid ring quiesce for fixed file set unregister and update")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c