Skip to content

Commit 08c600b

Browse files
nmantheygregkh
authored andcommitted
smb: client: mask server-provided mode to 07777 in modefromsid
commit e3d9c71 upstream. When modefromsid is active, parse_dacl() applies the server-provided sub_auth[2] value from the NFS mode SID to cf_mode without masking to 07777. Apply the correct masking, same as in the read path. Fixes: e2f8fbf ("cifs: get mode bits from special sid on stat") Signed-off-by: Norbert Manthey <nmanthey@amazon.de> Assisted-by: Kiro:claude-opus-4.6 Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0de5b8e commit 08c600b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/smb/client/cifsacl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,
890890
*/
891891
fattr->cf_mode &= ~07777;
892892
fattr->cf_mode |=
893-
le32_to_cpu(ppace[i]->sid.sub_auth[2]);
893+
le32_to_cpu(ppace[i]->sid.sub_auth[2]) & 07777;
894894
break;
895895
} else {
896896
if (compare_sids(&(ppace[i]->sid), pownersid) == 0) {

0 commit comments

Comments
 (0)