aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurélien Aptel <aaptel@suse.com>2017-10-11 07:23:36 -0400
committerSteve French <smfrench@gmail.com>2017-10-25 13:58:54 -0400
commitdb3b5474f462e77b82ca1e27627f03c47b622c99 (patch)
tree050af9770bae04fc16b274f9c5f29d0f789952c1
parent48923d2a9d4f6ca909102061a4240b9896ff8ea2 (diff)
CIFS: Fix NULL pointer deref on SMB2_tcon() failure
If SendReceive2() fails rsp is set to NULL but is dereferenced in the error handling code. Cc: stable@vger.kernel.org Signed-off-by: Aurelien Aptel <aaptel@suse.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r--fs/cifs/smb2pdu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index fa17caa56128..3efcd96b52c5 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1255,7 +1255,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
1255 struct smb2_tree_connect_req *req; 1255 struct smb2_tree_connect_req *req;
1256 struct smb2_tree_connect_rsp *rsp = NULL; 1256 struct smb2_tree_connect_rsp *rsp = NULL;
1257 struct kvec iov[2]; 1257 struct kvec iov[2];
1258 struct kvec rsp_iov; 1258 struct kvec rsp_iov = { NULL, 0 };
1259 int rc = 0; 1259 int rc = 0;
1260 int resp_buftype; 1260 int resp_buftype;
1261 int unc_path_len; 1261 int unc_path_len;
@@ -1372,7 +1372,7 @@ tcon_exit:
1372 return rc; 1372 return rc;
1373 1373
1374tcon_error_exit: 1374tcon_error_exit:
1375 if (rsp->hdr.sync_hdr.Status == STATUS_BAD_NETWORK_NAME) { 1375 if (rsp && rsp->hdr.sync_hdr.Status == STATUS_BAD_NETWORK_NAME) {
1376 cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree); 1376 cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
1377 } 1377 }
1378 goto tcon_exit; 1378 goto tcon_exit;