]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: call putname after using the last component
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 18 Dec 2023 15:33:57 +0000 (00:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:56 +0000 (10:41 +0100)
commit049ed0f953da554f75a5486940607b0d147e603f
tree945d0b6040e48f05a8d9143f1d9bb5413e262a27
parentb423ddab61383077953b8246e6caa2cea3e446c4
ksmbd: call putname after using the last component

[ Upstream commit 6fe55c2799bc29624770c26f98ba7b06214f43e0 ]

last component point filename struct. Currently putname is called after
vfs_path_parent_lookup(). And then last component is used for
lookup_one_qstr_excl(). name in last component is freed by previous
calling putname(). And It cause file lookup failure when testing
generic/464 test of xfstest.

Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/vfs.c