diff options
author | Pavel Shilovsky <pshilov@microsoft.com> | 2019-01-18 03:18:38 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-03-05 05:06:39 +0300 |
commit | bb1bccb60c2ebd9a6f895507d1d48d5ed773814e (patch) | |
tree | c12fe68438b442121504bb6de9f869de9a36364f /fs/cifs/smb2ops.c | |
parent | 66265f134acfb202465fecfbeb61fefb66595c40 (diff) | |
download | linux-bb1bccb60c2ebd9a6f895507d1d48d5ed773814e.tar.xz |
CIFS: Respect SMB2 hdr preamble size in read responses
There are a couple places where we still account for 4 bytes
in the beginning of SMB2 packet which is not true in the current
code. Fix this to use a header preamble size where possible.
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 5adfe68f4754..7291d8289511 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3244,10 +3244,10 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid, /* set up first two iov to get credits */ rdata->iov[0].iov_base = buf; - rdata->iov[0].iov_len = 4; - rdata->iov[1].iov_base = buf + 4; + rdata->iov[0].iov_len = 0; + rdata->iov[1].iov_base = buf; rdata->iov[1].iov_len = - min_t(unsigned int, buf_len, server->vals->read_rsp_size) - 4; + min_t(unsigned int, buf_len, server->vals->read_rsp_size); cifs_dbg(FYI, "0: iov_base=%p iov_len=%zu\n", rdata->iov[0].iov_base, rdata->iov[0].iov_len); cifs_dbg(FYI, "1: iov_base=%p iov_len=%zu\n", |