]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: not allow to open file if delelete on close bit is set
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 6 Oct 2023 01:41:36 +0000 (10:41 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:58:59 +0000 (11:58 +0200)
commit3898d8d685ab422a74d4e23500e4b45940ef1cf4
tree2c532153a40f5b3ab301bb05218be394dbcdcf30
parentd3dc26c4fdc29175b19ac5f8a4eaf96a7dd012c6
ksmbd: not allow to open file if delelete on close bit is set

[ Upstream commit f43328357defc0dc9d28dbd06dc3361fd2b22e28 ]

Cthon test fail with the following error.

check for proper open/unlink operation
nfsjunk files before unlink:
  -rwxr-xr-x 1 root root 0  9월 25 11:03 ./nfs2y8Jm9
./nfs2y8Jm9 open; unlink ret = 0
nfsjunk files after unlink:
  -rwxr-xr-x 1 root root 0  9월 25 11:03 ./nfs2y8Jm9
data compare ok
nfsjunk files after close:
  ls: cannot access './nfs2y8Jm9': No such file or directory
special tests failed

Cthon expect to second unlink failure when file is already unlinked.
ksmbd can not allow to open file if flags of ksmbd inode is set with
S_DEL_ON_CLS flags.

Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ksmbd/vfs_cache.c