]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: avoid putting the realm twice when decoding snaps fails
authorXiubo Li <xiubli@redhat.com>
Wed, 9 Nov 2022 03:00:39 +0000 (11:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:00 +0000 (11:23 +0100)
commitbbfb50fed447dca580b127c341dadaef21efbe29
tree0cdef5f10a725cc970d457315ff7e2d22535768b
parent0677b14cd9bee2f2bde1cab805124ebf6c97f1e2
ceph: avoid putting the realm twice when decoding snaps fails

[ Upstream commit 848e3060bf944e6f9f80165d754be5850e8c0e75 ]

When decoding the snaps fails it maybe leaving the 'first_realm'
and 'realm' pointing to the same snaprealm memory. And then it'll
put it twice and could cause random use-after-free, BUG_ON, etc
issues.

Cc: stable@vger.kernel.org
Link: https://tracker.ceph.com/issues/57686
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/snap.c