diff options
| author | koraynilay <koray.fra@gmail.com> | 2026-11-11 23:25:34 +0100 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-11-15 10:08:12 +0900 |
| commit | e803eb371559d64f337d3078d5e7749716b39160 (patch) | |
| tree | 3887867968c7725f7e021028757546ba53e64979 /tools/lib/python | |
| parent | 953e4f5a168238731a1ccf7c7631c83e19dbd7fd (diff) | |
ksmbd: fix timestamp corruption on special values
When a timestamp is being sent with "-1" or "-2" as its value because it
should be ignored, as specified in MS-FSCC 2.4.7 FileBasicInformation,
ksmbd would clobber it in both the xattr and on-disk value by setting it
to -1.
simple reproducer:
echo test > file.txt
smbclient //127.0.0.1/test -U user%pass -c "put file.txt repro.txt"
smbclient //127.0.0.1/test -U user%pass -c "allinfo repro.txt"
smbclient //127.0.0.1/test -U user%pass -c "setmode repro.txt +h"
stat repro.txt # the actual file on disk behind smb
smbclient //127.0.0.1/test -U user%pass -c "allinfo repro.txt"
which would show, respectively:
altname: REPRO~MQ.TXT
create_time: Wed Nov 11 21:23:16 2026 UTC
access_time: Wed Nov 11 21:23:16 2026 UTC
write_time: Wed Nov 11 21:23:16 2026 UTC
change_time: Wed Nov 11 21:23:16 2026 UTC
attributes: A (20)
File: /tmp/repro.txt
[...]
Access: 1601-01-01 00:00:00.000000000 +0000
Modify: 2026-11-11 21:58:10.145349236 +0000
Change: 2026-11-11 21:58:10.206350216 +0000
Birth: 2026-11-11 21:58:10.144349220 +0000
altname: REPRO~MQ.TXT
create_time: Wed Dec 31 23:59:59 1969 UTC
access_time: Mon Jan 1 00:00:04 1601 UTC
write_time: Wed Nov 11 21:23:16 2026 UTC
change_time: Wed Nov 11 21:23:16 2026 UTC
attributes: HA (22)
This patch also makes the smb2.timestamps.freeze-thaw test from
smbtorture pass.
Cc: stable@vger.kernel.org
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Link: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/16023025-8a78-492f-8b96-c873b042ac50
Assisted-by: Gemini:3.8-flash-high antigravity-cli-1.5.3
Signed-off-by: koraynilay <koray.fra@gmail.com>
Reviewed-by: Ian Bridges <icb@fastmail.org>
Tested-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
