From: Steve French Date: Sun, 17 Aug 2014 05:22:24 +0000 (-0500) Subject: CIFS: Possible null ptr deref in SMB2_tcon X-Git-Tag: v3.14.19~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6fc2f0c1df49edd76d34517133fab7fb93cd5cc;p=thirdparty%2Fkernel%2Fstable.git CIFS: Possible null ptr deref in SMB2_tcon commit 18f39e7be0121317550d03e267e3ebd4dbfbb3ce upstream. As Raphael Geissert pointed out, tcon_error_exit can dereference tcon and there is one path in which tcon can be null. Signed-off-by: Steve French Reported-by: Raphael Geissert Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 049a3f2693ba3..2f00b357e7433 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -916,7 +916,8 @@ tcon_exit: tcon_error_exit: if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) { cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree); - tcon->bad_network_name = true; + if (tcon) + tcon->bad_network_name = true; } goto tcon_exit; }