]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ceph: fix memory leaks in ceph_mdsc_build_path()
authorMax Kellermann <max.kellermann@ionos.com>
Tue, 24 Feb 2026 13:26:57 +0000 (14:26 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 9 Mar 2026 11:34:40 +0000 (12:34 +0100)
commit040d159a45ded7f33201421a81df0aa2a86e5a0b
tree01ded86871a0098f6ca6888609fb98d8ce7de8f6
parent43323a5934b660afae687e8e4e95ac328615a5c4
ceph: fix memory leaks in ceph_mdsc_build_path()

Add __putname() calls to error code paths that did not free the "path"
pointer obtained by __getname().  If ownership of this pointer is not
passed to the caller via path_info.path, the function must free it
before returning.

Cc: stable@vger.kernel.org
Fixes: 3fd945a79e14 ("ceph: encode encrypted name in ceph_mdsc_build_path and dentry release")
Fixes: 550f7ca98ee0 ("ceph: give up on paths longer than PATH_MAX")
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c