From owner-svn-src-head@FreeBSD.ORG Fri Nov 23 01:48:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FB49F0F; Fri, 23 Nov 2012 01:48:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 339628FC08; Fri, 23 Nov 2012 01:48:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN1mWZI011745; Fri, 23 Nov 2012 01:48:32 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN1mW1X011743; Fri, 23 Nov 2012 01:48:32 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201211230148.qAN1mW1X011743@svn.freebsd.org> From: Colin Percival Date: Fri, 23 Nov 2012 01:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243419 - in head: contrib/wpa/src/eap_server sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 01:48:32 -0000 Author: cperciva Date: Fri Nov 23 01:48:31 2012 New Revision: 243419 URL: http://svnweb.freebsd.org/changeset/base/243419 Log: MFS security patches which seem to have accidentally not reached HEAD: Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4445, CVE-2012-4576 With hat: so@ Modified: head/contrib/wpa/src/eap_server/eap_server_tls_common.c head/sys/compat/linux/linux_ioctl.c Modified: head/contrib/wpa/src/eap_server/eap_server_tls_common.c ============================================================================== --- head/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 23:15:38 2012 (r243418) +++ head/contrib/wpa/src/eap_server/eap_server_tls_common.c Fri Nov 23 01:48:31 2012 (r243419) @@ -225,6 +225,14 @@ static int eap_server_tls_process_fragme return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } + data->tls_in = wpabuf_alloc(message_length); if (data->tls_in == NULL) { wpa_printf(MSG_DEBUG, "SSL: No memory for message"); Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Thu Nov 22 23:15:38 2012 (r243418) +++ head/sys/compat/linux/linux_ioctl.c Fri Nov 23 01:48:31 2012 (r243419) @@ -2260,8 +2260,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE();