All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Hyunchul Lee <hyc.lee@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steve French <stfrench@microsoft.com>,
	Ronnie Sahlberg <lsahlber@redhat.com>,
	linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH] cifsd: fix a precedence bug in parse_dacl()
Date: Thu, 18 Mar 2021 16:10:21 +0300	[thread overview]
Message-ID: <YFNRPcVUXZ3EiEXN@mwanda> (raw)

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(-)

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 =
-- 
2.30.2


             reply	other threads:[~2021-03-18 13:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 13:10 Dan Carpenter [this message]
2021-03-19  4:44 ` [PATCH] cifsd: fix a precedence bug in parse_dacl() Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YFNRPcVUXZ3EiEXN@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=hyc.lee@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsahlber@redhat.com \
    --cc=namjae.jeon@samsung.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=stfrench@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.