All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CIFS: Fix NULL pointer deref on TCON failures
@ 2017-10-10 23:01 Ronnie Sahlberg
  2017-10-11 11:23 ` [PATCH] CIFS: Fix NULL pointer deref on SMB2_tcon() failure Aurelien Aptel
       [not found] ` <20171010230138.31832-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Ronnie Sahlberg @ 2017-10-10 23:01 UTC (permalink / raw)
  To: linux-cifs; +Cc: Steve French

Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/cifs/smb2pdu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 6f0e6343c15e..6ff4c275ca9a 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,
 	struct smb2_tree_connect_req *req;
 	struct smb2_tree_connect_rsp *rsp = NULL;
 	struct kvec iov[2];
-	struct kvec rsp_iov;
+	struct kvec rsp_iov = { NULL, 0 };
 	int rc = 0;
 	int resp_buftype;
 	int unc_path_len;
@@ -1315,6 +1315,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
 	rc = SendReceive2(xid, ses, iov, 2, &resp_buftype, flags, &rsp_iov);
 	cifs_small_buf_release(req);
 	rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base;
+	if (rsp == NULL)
+		goto tcon_exit;
 
 	if (rc != 0) {
 		if (tcon) {
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-11 18:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 23:01 [PATCH] CIFS: Fix NULL pointer deref on TCON failures Ronnie Sahlberg
2017-10-11 11:23 ` [PATCH] CIFS: Fix NULL pointer deref on SMB2_tcon() failure Aurelien Aptel
     [not found]   ` <20171011112336.11263-1-aaptel-IBi9RG/b67k@public.gmane.org>
2017-10-11 18:08     ` Pavel Shilovsky
2017-10-11 18:08       ` Pavel Shilovsky
     [not found] ` <20171010230138.31832-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-10 23:07   ` [PATCH] CIFS: Fix NULL pointer deref on TCON failures Steve French
2017-10-11 11:23   ` Aurélien Aptel
2017-10-11 15:18   ` Steve French

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.