io_uring: fix no lock protection for ctx->cq_extra
authorHao Xu <haoxu@linux.alibaba.com>
Thu, 25 Nov 2021 09:21:02 +0000 (17:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:33 +0000 (19:12 +0100)
commit1bd12b7aaee0c1c818101de4a46bb56b8fdc8ccb
treec6ff52bb01d36d08430ffe6b6efc59165388011a
parent384d1b11382b4d8065a1c3ce930e88c5193f9857
io_uring: fix no lock protection for ctx->cq_extra

[ Upstream commit e302f1046f4c209291b07ff7bc4d15ca26891f16 ]

ctx->cq_extra should be protected by completion lock so that the
req_need_defer() does the right check.

Cc: stable@vger.kernel.org
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20211125092103.224502-2-haoxu@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c