ksmbd: reject delete-on-close for read-only files

DELETE_ON_CLOSE is currently accepted for files carrying the read-only
DOS attribute. The server consequently creates or opens the file and
marks it for deletion instead of returning STATUS_CANNOT_DELETE.

Reject creation of a new read-only file with DELETE_ON_CLOSE. For an
existing file, load the stored DOS attributes before accepting the
create option. Also reject FileDispositionInformation when the opened
file has the read-only attribute.

Preserve the explicit STATUS_CANNOT_DELETE value while unwinding the
CREATE request.

This fixes smb2.delete-on-close-perms.READONLY.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Namjae Jeon 2026-07-05 15:43:29 +09:00
commit 497dbc5999