[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241227144343.volpdup7xx6xlsiq@pali>
Date: Fri, 27 Dec 2024 15:43:43 +0100
From: Pali Rohár <pali@...nel.org>
To: Steve French <sfrench@...ba.org>, Paulo Alcantara <pc@...guebit.com>,
Ronnie Sahlberg <ronniesahlberg@...il.com>
Cc: linux-cifs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] cifs: Fix getting and setting SACLs over SMB1
On Sunday 22 December 2024 16:10:48 Pali Rohár wrote:
> diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c
> index ba79aa2107cc..b07f3609adec 100644
> --- a/fs/smb/client/cifsacl.c
> +++ b/fs/smb/client/cifsacl.c
> @@ -1498,10 +1501,12 @@ int set_cifs_acl(struct smb_ntsd *pnntsd, __u32 acllen,
> tcon = tlink_tcon(tlink);
> xid = get_xid();
>
> - if (aclflag == CIFS_ACL_OWNER || aclflag == CIFS_ACL_GROUP)
> - access_flags = WRITE_OWNER;
> - else
> - access_flags = WRITE_DAC;
> + if (aclflag & CIFS_ACL_OWNER || aclflag & CIFS_ACL_GROUP)
> + access_flags |= WRITE_OWNER;
> + if (aclflag & CIFS_ACL_SACL)
> + access_flags |= SYSTEM_SECURITY;
> + if (aclflag & CIFS_ACL_DACL)
> + access_flags |= WRITE_DAC;
>
> oparms = (struct cifs_open_parms) {
> .tcon = tcon,
In this function is missing initialization of access_flags value after my change.
I can fix it by this simple fixup change:
diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c
index 1054c62ade6c..b3e2f1dad175 100644
--- a/fs/smb/client/cifsacl.c
+++ b/fs/smb/client/cifsacl.c
@@ -1488,7 +1488,7 @@ int set_cifs_acl(struct smb_ntsd *pnntsd, __u32 acllen,
{
int oplock = 0;
unsigned int xid;
- int rc, access_flags;
+ int rc, access_flags = 0;
struct cifs_tcon *tcon;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
Powered by blists - more mailing lists