]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked
authorHe Wang <xw897002528@gmail.com>
Mon, 6 Jan 2025 03:39:54 +0000 (03:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2025 12:34:41 +0000 (13:34 +0100)
commit13e41c58c74baa71f34c0830eaa3c29d53a6e964
tree06242fbe5782cc3a90980576a458990e502529e0
parentaabe47cf5ac5e1db2ae0635f189d836f67024904
ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked

[ Upstream commit 2ac538e40278a2c0c051cca81bcaafc547d61372 ]

When `ksmbd_vfs_kern_path_locked` met an error and it is not the last
entry, it will exit without restoring changed path buffer. But later this
buffer may be used as the filename for creation.

Fixes: c5a709f08d40 ("ksmbd: handle caseless file creation")
Signed-off-by: He Wang <xw897002528@gmail.com>
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/vfs.c