From owner-svn-src-all@FreeBSD.ORG Sun Sep 20 15:45:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 269F9106566C; Sun, 20 Sep 2009 15:45:57 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id EC16C8FC0A; Sun, 20 Sep 2009 15:45:56 +0000 (UTC) Received: from Macintosh-4.local (no-reverse.redstone-isp.net [212.44.18.222] (may be forged)) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n8KFjn37048619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Sep 2009 08:45:53 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4AB64E2C.4080800@freebsd.org> Date: Sun, 20 Sep 2009 16:45:48 +0100 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Konstantin Belousov References: <200909201240.n8KCeubH056620@svn.freebsd.org> In-Reply-To: <200909201240.n8KCeubH056620@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197348 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 20 Sep 2009 15:45:57 -0000 Konstantin Belousov wrote: > Author: kib > Date: Sun Sep 20 12:40:56 2009 > New Revision: 197348 > URL: http://svn.freebsd.org/changeset/base/197348 > > Log: > Old (a.out) rtld attempts to mmap zero-length region, e.g. when bss > of the linked object is zero-length. More old code assumes that mmap > of zero length returns success. > > For a.out and pre-8 ELF binaries, allow the mmap of zero length. > > Reported by: tegge > Reviewed by: tegge, alc, jhb > MFC after: 3 days > > Modified: > head/sys/vm/vm_mmap.c > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Sun Sep 20 12:24:55 2009 (r197347) > +++ head/sys/vm/vm_mmap.c Sun Sep 20 12:40:56 2009 (r197348) > @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -229,7 +230,8 @@ mmap(td, uap) > > fp = NULL; > /* make sure mapping fits into numeric range etc */ > - if (uap->len == 0 || > + if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && > + curproc->p_osrel >= 800104) || > ((flags & MAP_ANON) && uap->fd != -1)) > return (EINVAL); > > > This hack needs a comment. Sam