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:40:03 +0000 (17:40 +0100)
commitca3a08e9d9ebda0557c3a9d316e768f4d52c2168
tree4ed840df2725b00c496445461d621ee546624b34
parent00c004c070f22a47063de4ff2a5638fce1f94d95
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