]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: Fix memory leak in get_file_all_info()
authorZilin Guan <zilin@seu.edu.cn>
Wed, 24 Dec 2025 14:20:16 +0000 (14:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:16:51 +0000 (10:16 +0100)
commitd026f47db68638521df8543535ef863814fb01b1
tree6c5271860d1116ce0b992b8163f288e492365f0b
parentd260dff568ad6d0f0f2aef4a85058e0832d772c4
ksmbd: Fix memory leak in get_file_all_info()

[ Upstream commit 0c56693b06a68476ba113db6347e7897475f9e4c ]

In get_file_all_info(), if vfs_getattr() fails, the function returns
immediately without freeing the allocated filename, leading to a memory
leak.

Fix this by freeing the filename before returning in this error case.

Fixes: 5614c8c487f6a ("ksmbd: replace generic_fillattr with vfs_getattr")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/server/smb2pdu.c