Skip to contentSkip to conversation

cifsd: fix a precedence bug in parse_dacl()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 18, 2021 – Mar 19, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifsd: fix a precedence bug in parse_dacl()

The shift has higher precedence than mask so this doesn't work as intended.

Fixes ef24dca82789 ("cifsd: add support for ACLs")
---
 fs/cifsd/smbacl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifsd/smbacl.c +1 -1
index 8d8360ca4751..294c5a8fe9af 100644
@@ -520,7 +520,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,
 			fattr->cf_gid;
 		acl_state.groups->aces[acl_state.groups->n++].perms.allow =
 			(mode & 0070) >> 3;
-		default_acl_state.group.allow = mode & 0070 >> 3;
+		default_acl_state.group.allow = (mode & 0070) >> 3;
 		default_acl_state.groups->aces[default_acl_state.groups->n].gid =
 			fattr->cf_gid;
 		default_acl_state.groups->aces[default_acl_state.groups->n++].perms.allow =
Signature · 1 line
2.30.2