Re: [PATCH] ksmbd: fix timestamp corruption on special values

From: Ian Bridges

Date: Wed Nov 11 2026 - 22:15:48 EST


Hi,

On Wed, Nov 11, 2026 at 11:25:34PM +0100, koraynilay wrote:
> 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.

I tested this with the ksmbd code from ksmbd-for-next. Before the
patch, setting any of the four times to -1 or -2 stored that value.
The access and write times on disk moved to 1901, and the creation
time in the DOS attribute xattr was overwritten. With the patch, -1
and -2 leave every time unchanged, and valid times are still set as
before. smbtorture confirms the result in the commit message, the rest
of its results are unchanged, and KASAN reports nothing.

Reviewed-by: Ian Bridges <icb@xxxxxxxxxxxx>
Tested-by: Ian Bridges <icb@xxxxxxxxxxxx>