From owner-svn-src-head@freebsd.org Wed Jul 1 16:37:04 2015 Return-Path: Delivered-To: svn-src-head@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 1B5E39924E0; Wed, 1 Jul 2015 16:37:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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 0D0DD22B5; Wed, 1 Jul 2015 16:37:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t61Gb3wW022356; Wed, 1 Jul 2015 16:37:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t61Gb34r022355; Wed, 1 Jul 2015 16:37:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507011637.t61Gb34r022355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 1 Jul 2015 16:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285011 - head/sys/amd64/amd64 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.20 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: Wed, 01 Jul 2015 16:37:04 -0000 Author: kib Date: Wed Jul 1 16:37:03 2015 New Revision: 285011 URL: https://svnweb.freebsd.org/changeset/base/285011 Log: Disallow a debugger on 64bit system to set fs/gs bases of the 32bit process beyond the end of the process address space. Such setting is not dangerous to the kernel integrity, but it causes confusing application misbehaviour. Sponsored by: The FreeBSD Foundation MFC after: 12 days Modified: head/sys/amd64/amd64/ptrace_machdep.c Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Wed Jul 1 15:54:13 2015 (r285010) +++ head/sys/amd64/amd64/ptrace_machdep.c Wed Jul 1 16:37:03 2015 (r285011) @@ -231,7 +231,7 @@ cpu_ptrace(struct thread *td, int req, v error = copyin(addr, &rv, sizeof(rv)); if (error != 0) break; - if (rv >= VM_MAXUSER_ADDRESS) { + if (rv >= td->td_proc->p_sysent->sv_maxuser) { error = EINVAL; break; }