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>
Fri, 2 Dec 2022 16:40:03 +0000 (17:40 +0100)
commit69263bf781bef3841f22815b834a5243474aa6d4
tree65e4cfe9ec899803ad7ddf94f8b41252abd7ab96
parent8e137ace53339eae14ced15143f95194a14999fd
ceph: fix possible NULL pointer dereference for req->r_session

[ Upstream commit 7acae6183cf37c48b8da48bbbdb78820fb3913f3 ]

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>
Stable-dep-of: 5bd76b8de5b7 ("ceph: fix NULL pointer dereference for req->r_session")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/caps.c