diff options
| author | DaeMyung Kang <charsyam@gmail.com> | 2026-10-09 00:25:36 +0900 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-14 07:20:21 +0900 |
| commit | 4cfb07ac1392b9c557b7c9040ba52a0f994f03dc (patch) | |
| tree | 7356a023f5335b936685bd2877b5a1300374448b /tools/lib/python | |
| parent | 75ec58968fe742c8656b921eaedb5bc34d6ca0f3 (diff) | |
| download | linux-next-4cfb07ac1392b9c557b7c9040ba52a0f994f03dc.tar.gz linux-next-4cfb07ac1392b9c557b7c9040ba52a0f994f03dc.zip | |
ksmbd: use the existing xattr name for a named stream
SMB stream names are case-insensitive, but ksmbd stores each named
stream in an xattr whose name is case-sensitive. Opening an existing
stream finds its xattr with a case-insensitive match, yet the handle
keeps the name as the client spelled it, and every later operation that
needs an exact name uses that spelling:
- a WRITE or an end-of-file change creates a second xattr, so a stream
created as "Foo" and written through "foo" ends up stored twice, and
which value a later lookup returns depends on xattr list order;
- delete-on-close and delete-pending removal can fail with -ENODATA,
or remove only a case-variant copy and leave the original;
- the share mode check compares stream names with strcmp(), so two
opens of the same stream that differ only in case do not conflict.
Have ksmbd_vfs_casexattr_len() copy the matching xattr's name into the
handle when the stream is opened, so later operations use the name
already on disk. The match must have the same length as the name it
replaces; the stream lookup passes a length that includes the
terminating NUL, which already guarantees that, and the check makes the
copy safe for any caller. A stream that does not exist yet keeps the
client's spelling, as before.
smb2_rename() compares and looks up fp->stream.name case-insensitively,
so it behaves the same with either spelling.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
