Re: [PATCH] ksmbd: reject FILE_ATTRIBUTE_TEMPORARY on directories

From: Namjae Jeon

Date: Tue Oct 20 2026 - 21:21:33 EST


On Wed, Oct 21, 2026 at 4:03 AM Michail Andreas Michalopoulos
<mike.michalo@xxxxxxxxx> wrote:
>
> Setting FILE_ATTRIBUTE_TEMPORARY on a directory with SMB2 SET_INFO
> (FileBasicInformation) succeeds: ksmbd keeps the attribute and, with
> "store dos attributes" enabled, also writes it to the DOS attribute
> xattr.
>
> MS-FSA (FileBasicInformation) says the request must fail with
> STATUS_INVALID_PARAMETER when FILE_ATTRIBUTE_TEMPORARY is set on a
> directory, and Samba rejects it too. smbtorture's
> smb2.create.dosattr_tmp_dir checks this and fails against ksmbd.
>
> Return -EINVAL, which is sent as STATUS_INVALID_PARAMETER, when a
> directory is asked to become TEMPORARY. Do the check before any
> timestamp is changed, so a rejected request leaves the open file and
> the inode unchanged.
>
> Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
> Assisted-by: LLM
> Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@xxxxxxxxx>
Applied it to #ksmbd-for-next.
Thanks!