Skip to content

Commit 7d3fc01

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: create sd context must be a multiple of 8
We used to follow the rule earlier that the create SD context always be a multiple of 8. However, with the change: cifs: refactor create_sd_buf() and and avoid corrupting the buffer ...we recompute the length, and we failed that rule. Fixing that with this change. Cc: <[email protected]> # v5.10+ Signed-off-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent c500bee commit 7d3fc01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,7 @@ create_sd_buf(umode_t mode, bool set_owner, unsigned int *len)
24262426
memcpy(aclptr, &acl, sizeof(struct cifs_acl));
24272427

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

24312431
return buf;
24322432
}

0 commit comments

Comments
 (0)