diff options
| author | ChenXiaoSong <chenxiaosong@kylinos.cn> | 2026-08-03 17:21:17 +0900 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-08-17 15:01:00 +0900 |
| commit | 2d99fbd7ad36ef288700f00102aaee11bcae04b4 (patch) | |
| tree | 094cc3bb9427e4fab8ef9933d4f4c249de1cc200 /scripts/stackusage | |
| parent | a3bcea7c819a6c69ca937a68631311711bf20e66 (diff) | |
| download | linux-2d99fbd7ad36ef288700f00102aaee11bcae04b4.tar.gz linux-2d99fbd7ad36ef288700f00102aaee11bcae04b4.zip | |
smb/server: fix posix state check for directory rename
Pass the source ksmbd_file to the rename helpers and use the per-handle
POSIX create-context state when deciding whether open children block a
directory rename.
work->tcon->posix_extensions only records whether POSIX extensions were
negotiated on the connection. It does not indicate that the handles were
opened with POSIX create contexts.
Reproducer:
1. server: systemctl start ksmbd
2. client: mount -t cifs //${server_ip}/export /mnt
# without posix option
3. client: mkdir /mnt/dir1/; touch /mnt/dir1/file
4. client: tail -f /mnt/dir1/file # open file
5. client: mv /mnt/dir1 /mnt/dir2
Without this fix, the rename can succeed when it should fail with
"Permission denied".
Fixes: c841bd3d8dec ("ksmbd: deny renaming directory with open children")
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
