]> git.ipfire.org Git - thirdparty/linux.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)
committerSteve French <stfrench@microsoft.com>
Mon, 29 Dec 2025 23:39:57 +0000 (17:39 -0600)
commit0c56693b06a68476ba113db6347e7897475f9e4c
tree11b17c89a65b135eeb95cee843af0b7e1973c67c
parentf8f9c1f4d0c7a64600e2ca312dec824a0bc2f1da
ksmbd: Fix memory leak in get_file_all_info()

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>
fs/smb/server/smb2pdu.c