From owner-svn-src-all@freebsd.org Tue Aug 25 20:48:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B16B299A684; Tue, 25 Aug 2015 20:48:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96AC1983; Tue, 25 Aug 2015 20:48:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7PKmknl050989; Tue, 25 Aug 2015 20:48:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7PKmjeR050985; Tue, 25 Aug 2015 20:48:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201508252048.t7PKmjeR050985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 25 Aug 2015 20:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r287144 - in stable: 10/crypto/openssh 9/crypto/openssh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2015 20:48:46 -0000 Author: delphij Date: Tue Aug 25 20:48:44 2015 New Revision: 287144 URL: https://svnweb.freebsd.org/changeset/base/287144 Log: MFC: Fix OpenSSH multiple vulnerabilities. Security: FreeBSD-SA-15:22.openssh Modified: stable/9/crypto/openssh/monitor.c stable/9/crypto/openssh/monitor_wrap.c stable/9/crypto/openssh/mux.c Changes in other areas also in this revision: Modified: stable/10/crypto/openssh/monitor.c stable/10/crypto/openssh/monitor_wrap.c stable/10/crypto/openssh/mux.c Modified: stable/9/crypto/openssh/monitor.c ============================================================================== --- stable/9/crypto/openssh/monitor.c Tue Aug 25 20:48:37 2015 (r287143) +++ stable/9/crypto/openssh/monitor.c Tue Aug 25 20:48:44 2015 (r287144) @@ -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: stable/9/crypto/openssh/monitor_wrap.c ============================================================================== --- stable/9/crypto/openssh/monitor_wrap.c Tue Aug 25 20:48:37 2015 (r287143) +++ stable/9/crypto/openssh/monitor_wrap.c Tue Aug 25 20:48:44 2015 (r287144) @@ -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: stable/9/crypto/openssh/mux.c ============================================================================== --- stable/9/crypto/openssh/mux.c Tue Aug 25 20:48:37 2015 (r287143) +++ stable/9/crypto/openssh/mux.c Tue Aug 25 20:48:44 2015 (r287144) @@ -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 ||