Re: [PATCH] ksmbd: compare the whole SID when adding POSIX ACL entries to a DACL

From: Namjae Jeon

Date: Fri Nov 20 2026 - 05:22:17 EST


On Fri, Nov 20, 2026 at 4:10 AM Ian Bridges <icb@xxxxxxxxxxxx> wrote:
>
> When a query returns a stored DACL, set_posix_acl_entries_dacl() adds
> an ACE for each POSIX ACL entry that the stored DACL does not already
> have. It checks that by comparing only the last sub-authority of the
> SIDs. A POSIX entry is then left out when a stored ACE for another
> principal ends in the same number. For example, a stored ACE for unix
> group 1300 hides the POSIX entry for the user with uid 1300, so the
> query does not show that this user has access.
>
> Compare the whole SID. A POSIX entry for uid 0 is shown as S-1-22-1-0,
> but sid_to_id() maps the domain SID with RID 0 to uid 0, so a stored
> ACE with that SID also counts for it.
>
> 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!