diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2021-08-04 21:37:22 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-08-05 20:48:42 +0300 |
commit | 7d3fc01796fc895e5fcce45c994c5a8db8120a8d (patch) | |
tree | 03f032784ea705208eaf805ccc5e1c51eb4051c7 /fs/cifs/smb2pdu.c | |
parent | c500bee1c5b2f1d59b1081ac879d73268ab0ff17 (diff) | |
download | linux-7d3fc01796fc895e5fcce45c994c5a8db8120a8d.tar.xz |
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: <stable@vger.kernel.org> # v5.10+
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r-- | fs/cifs/smb2pdu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 781d14e5f2af..b6d2e3591927 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2426,7 +2426,7 @@ create_sd_buf(umode_t mode, bool set_owner, unsigned int *len) memcpy(aclptr, &acl, sizeof(struct cifs_acl)); buf->ccontext.DataLength = cpu_to_le32(ptr - (__u8 *)&buf->sd); - *len = ptr - (__u8 *)buf; + *len = roundup(ptr - (__u8 *)buf, 8); return buf; } |