ceph: fix NULL pointer dereference for req->r_session
authorXiubo Li <xiubli@redhat.com>
Thu, 10 Nov 2022 13:01:59 +0000 (21:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:01 +0000 (17:41 +0100)
commit855485d31e2ac011c2ce7031674c8b5c73321cc4
treeaddaeff5d7f7597301778001c39fbc7f2a6dc526
parent729c9ad2940e6cc50d7cd2c2bd57f47c189eea9e
ceph: fix NULL pointer dereference for req->r_session

[ Upstream commit 5bd76b8de5b74fa941a6eafee87728a0fe072267 ]

The request's r_session maybe changed when it was forwarded or
resent. Both the forwarding and resending cases the requests will
be protected by the mdsc->mutex.

Cc: stable@vger.kernel.org
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2137955
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/caps.c