io_uring: fix races with buffer table unregister
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 13 Jun 2022 05:30:06 +0000 (06:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:22:00 +0000 (14:22 +0200)
commit91f5a60a8398fd2183309eb8aaad11d524fe4957
tree1647a7b9ee6e318250a6ef459d6e51348a04f57e
parentb1e7cade3cafc593905f9ed81e7f6db3034eee1d
io_uring: fix races with buffer table unregister

[ Upstream commit d11d31fc5d8a96f707facee0babdcffaafa38de2 ]

Fixed buffer 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: bd54b6fe3316ec ("io_uring: implement fixed buffers registration similar to fixed files")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c