diff mbox series

cifsd: fix a precedence bug in parse_dacl()

Message ID YFNRPcVUXZ3EiEXN@mwanda (mailing list archive)
State New, archived
Headers show
Series cifsd: fix a precedence bug in parse_dacl() | expand

Commit Message

Dan Carpenter March 18, 2021, 1:10 p.m. UTC
The shift has higher precedence than mask so this doesn't work as
intended.

Fixes: ef24dca82789 ("cifsd: add support for ACLs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/cifsd/smbacl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sergey Senozhatsky March 19, 2021, 4:44 a.m. UTC | #1
On (21/03/18 16:10), Dan Carpenter wrote:
> 
> The shift has higher precedence than mask so this doesn't work as
> intended.
> 
> Fixes: ef24dca82789 ("cifsd: add support for ACLs")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

	-ss
diff mbox series

Patch

diff --git a/fs/cifsd/smbacl.c b/fs/cifsd/smbacl.c
index 8d8360ca4751..294c5a8fe9af 100644
--- a/fs/cifsd/smbacl.c
+++ b/fs/cifsd/smbacl.c
@@ -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 =