diff options
author | Pavel Shilovsky <pshilov@microsoft.com> | 2017-04-10 20:31:33 +0300 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2017-04-11 07:36:38 +0300 |
commit | 350be257ea83029daee974c72b1fe2e6f1f8e615 (patch) | |
tree | c02cd0c1e5bdf4b1cb58b4dcd307f508f02fda73 /fs/cifs/smb2ops.c | |
parent | c08e611b7d0169b513e3b4515ffd51ac7f37f22c (diff) | |
download | linux-350be257ea83029daee974c72b1fe2e6f1f8e615.tar.xz |
CIFS: Fix null pointer deref during read resp processing
Currently during receiving a read response mid->resp_buf can be
NULL when it is being passed to cifs_discard_remaining_data() from
cifs_readv_discard(). Fix it by always passing server->smallbuf
instead and initializing mid->resp_buf at the end of read response
processing.
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 7b12a727947e..152e37f2ad92 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -2195,7 +2195,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid) if (rc) goto free_pages; - rc = cifs_discard_remaining_data(server, buf); + rc = cifs_discard_remaining_data(server); if (rc) goto free_pages; @@ -2221,7 +2221,7 @@ free_pages: kfree(pages); return rc; discard_data: - cifs_discard_remaining_data(server, buf); + cifs_discard_remaining_data(server); goto free_pages; } |