Re: [PATCH] ksmbd: don't take an existing file's attributes from an open request
From: Namjae Jeon
Date: Fri Nov 27 2026 - 20:17:32 EST
On Sat, Nov 28, 2026 at 9:09 AM Ian Bridges <icb@xxxxxxxxxxxx> wrote:
>
> When smb2_open() opens an existing file that has no other open handle,
> it sets the cached attributes of the file from the FileAttributes field
> of the request. MS-FSA uses that field only when a file is created or
> overwritten. Any other open of an existing file ignores it.
>
> The cached attributes are shared by all handles to the file. So the
> client that first opens an existing file decides the attributes that
> the other clients see while its handle is open. Stored DOS attributes
> replace them only on a share that stores DOS attributes and only if
> the file has them. If the DOS attributes are written while the handle
> is open, the attributes from the request are stored and stay after the
> last close. ksmbd also bases its own checks on the cached attributes.
>
> Take the attributes from the request only for a new file. An open of an
> existing file starts from the attributes that the inode implies, and
> the stored DOS attributes are read as before. An overwrite still takes
> the attributes from the request.
>
> Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Ian Bridges <icb@xxxxxxxxxxxx>
Applied it to #ksmbd-for-next.
Thanks!