ceph: fix use-after-free for fsc->mdsc
authorXiubo Li <xiubli@redhat.com>
Thu, 23 Jul 2020 07:32:25 +0000 (15:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Aug 2020 09:49:06 +0000 (11:49 +0200)
commit8d5b9bb9a58a0b3b3f421aafe0478ff0141cf4dc
tree8c1a16046e39cd1d69a3ba82c051de37dad02375
parent17754f71db7b4d466ef5a19056b9b04d6b080683
ceph: fix use-after-free for fsc->mdsc

[ Upstream commit a7caa88f8b72c136f9a401f498471b8a8e35370d ]

If the ceph_mdsc_init() fails, it will free the mdsc already.

Reported-by: syzbot+b57f46d8d6ea51960b8c@syzkaller.appspotmail.com
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/mds_client.c