Re: [PATCH v2] ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow
From: Namjae Jeon
Date: Mon Nov 02 2026 - 18:41:45 EST
> @@ -1562,7 +1586,8 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
> compare_sids(&sid_unix_NFS_mode, &ace->sid) &&
> compare_sids(&sid_everyone, &ace->sid) &&
> compare_sids(&sid_authusers, &ace->sid) &&
> - compare_sids(&sid_owner_rights, &ace->sid)))
> + compare_sids(&sid_owner_rights, &ace->sid) &&
> + !(groups && smb_sid_in_group(&ace->sid))))
groups is false for MAXIMUM_ALLOWED, so this skips group deny ACEs
too. Consider a file owner whose group has a deny ACE for
FILE_WRITE_RIGHTS, followed by an OWNER RIGHTS ACE granting full
access. The group deny ACE is skipped, leaving full access in ordered.
The new fallback then returns those rights.
An explicit FILE_WRITE_DATA request is denied, but MAXIMUM_ALLOWED
returns 0x001f01ff, including write access. Before this patch, the
latter request was rejected. Since smb2_open() uses this mask for the
handle's access rights, the client can write if the vfs permissions
allow it. Could we also process group deny ACEs for MAXIMUM_ALLOWED
requests?