mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
smb3: correct smb3 ACL security descriptor
[ Upstream commit b06d893ef2 ]
Address warning:
fs/smbfs_client/smb2pdu.c:2425 create_sd_buf()
warn: struct type mismatch 'smb3_acl vs cifs_acl'
Pointed out by Dan Carpenter via smatch code analysis tool
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a7be240d17
commit
84778fd66d
|
|
@ -2339,7 +2339,7 @@ create_sd_buf(umode_t mode, bool set_owner, unsigned int *len)
|
||||||
buf->sd.OffsetDacl = cpu_to_le32(ptr - (__u8 *)&buf->sd);
|
buf->sd.OffsetDacl = cpu_to_le32(ptr - (__u8 *)&buf->sd);
|
||||||
/* Ship the ACL for now. we will copy it into buf later. */
|
/* Ship the ACL for now. we will copy it into buf later. */
|
||||||
aclptr = ptr;
|
aclptr = ptr;
|
||||||
ptr += sizeof(struct cifs_acl);
|
ptr += sizeof(struct smb3_acl);
|
||||||
|
|
||||||
/* create one ACE to hold the mode embedded in reserved special SID */
|
/* create one ACE to hold the mode embedded in reserved special SID */
|
||||||
acelen = setup_special_mode_ACE((struct cifs_ace *)ptr, (__u64)mode);
|
acelen = setup_special_mode_ACE((struct cifs_ace *)ptr, (__u64)mode);
|
||||||
|
|
@ -2364,7 +2364,7 @@ create_sd_buf(umode_t mode, bool set_owner, unsigned int *len)
|
||||||
acl.AclRevision = ACL_REVISION; /* See 2.4.4.1 of MS-DTYP */
|
acl.AclRevision = ACL_REVISION; /* See 2.4.4.1 of MS-DTYP */
|
||||||
acl.AclSize = cpu_to_le16(acl_size);
|
acl.AclSize = cpu_to_le16(acl_size);
|
||||||
acl.AceCount = cpu_to_le16(ace_count);
|
acl.AceCount = cpu_to_le16(ace_count);
|
||||||
memcpy(aclptr, &acl, sizeof(struct cifs_acl));
|
memcpy(aclptr, &acl, sizeof(struct smb3_acl));
|
||||||
|
|
||||||
buf->ccontext.DataLength = cpu_to_le32(ptr - (__u8 *)&buf->sd);
|
buf->ccontext.DataLength = cpu_to_le32(ptr - (__u8 *)&buf->sd);
|
||||||
*len = roundup(ptr - (__u8 *)buf, 8);
|
*len = roundup(ptr - (__u8 *)buf, 8);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user