ceph: fix possible NULL pointer dereference for req->r_session
authorXiubo Li <xiubli@redhat.com>
Thu, 14 Apr 2022 01:07:21 +0000 (09:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:14:30 +0000 (09:14 +0200)
commit732f861dd4806111adf08818d20a6e1e5467e94d
tree47ec4ff0e1be5daec738e7ccd430a468aff1c590
parent2b008197a06b203208d9cd31ccabc3d24260b713
ceph: fix possible NULL pointer dereference for req->r_session

commit 7acae6183cf37c48b8da48bbbdb78820fb3913f3 upstream.

The request will be inserted into the ci->i_unsafe_dirops before
assigning the req->r_session, so it's possible that we will hit
NULL pointer dereference bug here.

Cc: stable@vger.kernel.org
URL: https://tracker.ceph.com/issues/55327
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Aaron Tomlin <atomlin@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/caps.c