Skip to content

Commit b06d893

Browse files
committed
smb3: correct smb3 ACL security descriptor
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 <[email protected]> Acked-by: Ronnie Sahlberg <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4f22262 commit b06d893

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/cifs/smb2pdu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@ create_sd_buf(umode_t mode, bool set_owner, unsigned int *len)
23972397
buf->sd.OffsetDacl = cpu_to_le32(ptr - (__u8 *)&buf->sd);
23982398
/* Ship the ACL for now. we will copy it into buf later. */
23992399
aclptr = ptr;
2400-
ptr += sizeof(struct cifs_acl);
2400+
ptr += sizeof(struct smb3_acl);
24012401

24022402
/* create one ACE to hold the mode embedded in reserved special SID */
24032403
acelen = setup_special_mode_ACE((struct cifs_ace *)ptr, (__u64)mode);
@@ -2422,7 +2422,7 @@ create_sd_buf(umode_t mode, bool set_owner, unsigned int *len)
24222422
acl.AclRevision = ACL_REVISION; /* See 2.4.4.1 of MS-DTYP */
24232423
acl.AclSize = cpu_to_le16(acl_size);
24242424
acl.AceCount = cpu_to_le16(ace_count);
2425-
memcpy(aclptr, &acl, sizeof(struct cifs_acl));
2425+
memcpy(aclptr, &acl, sizeof(struct smb3_acl));
24262426

24272427
buf->ccontext.DataLength = cpu_to_le32(ptr - (__u8 *)&buf->sd);
24282428
*len = roundup(ptr - (__u8 *)buf, 8);

0 commit comments

Comments
 (0)