Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 2015 20:48:37 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287143 - head/crypto/openssh
Message-ID:  <201508252048.t7PKmbKS050933@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Tue Aug 25 20:48:37 2015
New Revision: 287143
URL: https://svnweb.freebsd.org/changeset/base/287143

Log:
  Fix OpenSSH multiple vulnerabilities by backporting three changes
  from OpenSSH-portable master.
  
  Git revisions:	45b0eb752c94954a6de046bfaaf129e518ad4b5b
  		5e75f5198769056089fb06c4d738ab0e5abc66f7
  		d4697fe9a28dab7255c60433e4dd23cf7fce8a8b
  Reviewed by:	des
  Security:	FreeBSD-SA-15:22.openssh

Modified:
  head/crypto/openssh/monitor.c
  head/crypto/openssh/monitor_wrap.c
  head/crypto/openssh/mux.c

Modified: head/crypto/openssh/monitor.c
==============================================================================
--- head/crypto/openssh/monitor.c	Tue Aug 25 20:14:50 2015	(r287142)
+++ head/crypto/openssh/monitor.c	Tue Aug 25 20:48:37 2015	(r287143)
@@ -1027,9 +1027,7 @@ extern KbdintDevice sshpam_device;
 int
 mm_answer_pam_init_ctx(int sock, Buffer *m)
 {
-
 	debug3("%s", __func__);
-	authctxt->user = buffer_get_string(m, NULL);
 	sshpam_ctxt = (sshpam_device.init_ctx)(authctxt);
 	sshpam_authok = NULL;
 	buffer_clear(m);
@@ -1111,14 +1109,16 @@ mm_answer_pam_respond(int sock, Buffer *
 int
 mm_answer_pam_free_ctx(int sock, Buffer *m)
 {
+	int r = sshpam_authok != NULL && sshpam_authok == sshpam_ctxt;
 
 	debug3("%s", __func__);
 	(sshpam_device.free_ctx)(sshpam_ctxt);
+	sshpam_ctxt = sshpam_authok = NULL;
 	buffer_clear(m);
 	mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m);
 	auth_method = "keyboard-interactive";
 	auth_submethod = "pam";
-	return (sshpam_authok == sshpam_ctxt);
+	return r;
 }
 #endif
 

Modified: head/crypto/openssh/monitor_wrap.c
==============================================================================
--- head/crypto/openssh/monitor_wrap.c	Tue Aug 25 20:14:50 2015	(r287142)
+++ head/crypto/openssh/monitor_wrap.c	Tue Aug 25 20:48:37 2015	(r287143)
@@ -820,7 +820,6 @@ mm_sshpam_init_ctx(Authctxt *authctxt)
 
 	debug3("%s", __func__);
 	buffer_init(&m);
-	buffer_put_cstring(&m, authctxt->user);
 	mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m);
 	debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__);
 	mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_INIT_CTX, &m);

Modified: head/crypto/openssh/mux.c
==============================================================================
--- head/crypto/openssh/mux.c	Tue Aug 25 20:14:50 2015	(r287142)
+++ head/crypto/openssh/mux.c	Tue Aug 25 20:48:37 2015	(r287143)
@@ -635,7 +635,8 @@ process_mux_open_fwd(u_int rid, Channel 
 	u_int lport, cport;
 	int i, ret = 0, freefwd = 1;
 
-	fwd.listen_host = fwd.connect_host = NULL;
+	memset(&fwd, 0, sizeof(fwd));
+
 	if (buffer_get_int_ret(&ftype, m) != 0 ||
 	    (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL ||
 	    buffer_get_int_ret(&lport, m) != 0 ||
@@ -785,7 +786,8 @@ process_mux_close_fwd(u_int rid, Channel
 	int i, listen_port, ret = 0;
 	u_int lport, cport;
 
-	fwd.listen_host = fwd.connect_host = NULL;
+	memset(&fwd, 0, sizeof(fwd));
+
 	if (buffer_get_int_ret(&ftype, m) != 0 ||
 	    (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL ||
 	    buffer_get_int_ret(&lport, m) != 0 ||



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508252048.t7PKmbKS050933>