smb: client: mask server-provided mode to 07777 in modefromsid
Subsystems (3)
PATCH 1/1 smb: client: mask server-provided mode to 07777 in modefromsid
From: Norbert Manthey <[email protected]>
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 e2f8fbfb8d09c ("cifs: get mode bits from special sid on stat")
Signed-off-by Norbert Manthey <[email protected]>
Assisted-by Kiro:claude-opus-4.6
--- fs/smb/client/cifsacl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cifsacl.c +1 -1
@@ -962,7 +962,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,*/ fattr->cf_mode &= ~07777 ; fattr->cf_mode |= -le32_to_cpu (ppace[i]->sid.sub_auth[2 ]); +le32_to_cpu (ppace[i]->sid.sub_auth[2 ]) &07777 ;break ; }else {if (compare_sids (&(ppace[i]->sid), pownersid) ==0 ) {
Signature · 1 line
2.50.1
Steve French
Appliedmerged into cifs-2.6.git for-next
Quoted 32 lines · Bjoern Doebel
From: Norbert Manthey <[email protected]>
When modefromsid is active,
parse_dacl()applies the server-provided sub_auth[2] value from the NFS mode SID tocf_modewithout masking to 07777. Apply the correct masking, same as in the read path.Fixes e2f8fbfb8d09c ("cifs: get mode bits from special sid on stat")Signed-off-by Norbert Manthey <[email protected]>Assisted-by Kiro:claude-opus-4.6--- fs/smb/client/cifsacl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/smb/client/cifsacl.c +1
-2@@ -962,7 +962,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,*/ fattr->cf_mode &= ~07777 ; fattr->cf_mode |= -le32_to_cpu (ppace[i]->sid.sub_auth[2 ]); +le32_to_cpu (ppace[i]->sid.sub_auth[2 ]) &07777 ;break ; }else {if (compare_sids (&(ppace[i]->sid), pownersid) ==0 ) { --2.50.1
Signature · 3 lines
Thanks, Steve