Skip to content

Commit 18f39e7

Browse files
committed
[CIFS] Possible null ptr deref in SMB2_tcon
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 <smfrench@gmail.com> CC: Stable <stable@vger.kernel.org> # v3.7+ Reported-by: Raphael Geissert <geissert@debian.org>
1 parent 754789a commit 18f39e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cifs/smb2pdu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
907907
tcon_error_exit:
908908
if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) {
909909
cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
910-
tcon->bad_network_name = true;
910+
if (tcon)
911+
tcon->bad_network_name = true;
911912
}
912913
goto tcon_exit;
913914
}

0 commit comments

Comments
 (0)