Re: [PATCH] ksmbd: ignore the allocation size create context on a read-only share

From: Namjae Jeon

Date: Thu Nov 12 2026 - 20:40:38 EST


On Fri, Nov 13, 2026 at 3:36 AM Ian Bridges <icb@xxxxxxxxxxxx> wrote:
>
> On a read-only share, ksmbd refuses writes over SMB, even from a user
> whose account could write the files in the underlying filesystem. Such
> a user can still open an existing file for write on the share, but the
> WRITE requests that follow are refused.
>
> If the open carries an SMB2_CREATE_ALLOCATION_SIZE create context,
> smb2_open() still calls vfs_fallocate() on the file, and the filesystem
> allows it because of the user's write permission. The user can thereby
> reserve any amount of disk space through the read-only share, up to
> filling the filesystem. The file's size and data do not change.
>
> Ignore the context on read-only shares. It requests space for a file
> being created or overwritten, and such a share permits neither.
>
> 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!