From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 23:34:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83F8FE36; Wed, 18 Feb 2015 23:34:04 +0000 (UTC) Received: from svn.freebsd.org (svn.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 6F4E515B; Wed, 18 Feb 2015 23:34:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1INY4vd076586; Wed, 18 Feb 2015 23:34:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1INY463076584; Wed, 18 Feb 2015 23:34:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502182334.t1INY463076584@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Feb 2015 23:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278976 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head 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.18-1 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: Wed, 18 Feb 2015 23:34:04 -0000 Author: jhb Date: Wed Feb 18 23:34:03 2015 New Revision: 278976 URL: https://svnweb.freebsd.org/changeset/base/278976 Log: Ensure that the supplied data length is large enough to hold the base FPU state to avoid passing a negative length to fpusetregs() / npxsetregs(). Differential Revision: https://reviews.freebsd.org/D1861 Reviewed by: kib, emaste Modified: head/sys/amd64/amd64/ptrace_machdep.c head/sys/i386/i386/ptrace_machdep.c Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Wed Feb 18 23:10:15 2015 (r278975) +++ head/sys/amd64/amd64/ptrace_machdep.c Wed Feb 18 23:34:03 2015 (r278976) @@ -88,7 +88,8 @@ cpu_ptrace_xstate(struct thread *td, int break; case PT_SETXSTATE: - if (data > cpu_max_ext_state_size) { + if (data < sizeof(struct savefpu) || + data > cpu_max_ext_state_size) { error = EINVAL; break; } Modified: head/sys/i386/i386/ptrace_machdep.c ============================================================================== --- head/sys/i386/i386/ptrace_machdep.c Wed Feb 18 23:10:15 2015 (r278975) +++ head/sys/i386/i386/ptrace_machdep.c Wed Feb 18 23:34:03 2015 (r278976) @@ -92,7 +92,8 @@ cpu_ptrace_xstate(struct thread *td, int break; case PT_SETXSTATE: - if (data > cpu_max_ext_state_size) { + if (data < sizeof(union savefpu) || + data > cpu_max_ext_state_size) { error = EINVAL; break; }