Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jun 2019 09:57:56 -0500
From:      Doug Moore <unkadoug@gmail.com>
To:        Shawn Webb <shawn.webb@hardenedbsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@freebsd.org
Subject:   Re: svn commit: r348843 - head/sys/vm
Message-ID:  <65cab520-731a-3256-8a71-bb8cfcc93011@gmail.com>
In-Reply-To: <20190610142715.be254wljfrnetuom@mutt-hbsd>
References:  <201906100307.x5A37BFt099669@repo.freebsd.org> <20190610130034.k2nzitvaxvpj5lzx@mutt-hbsd> <c084ec12-5f44-c3e1-bad0-2c702a3032f9@freebsd.org> <20190610142715.be254wljfrnetuom@mutt-hbsd>

next in thread | previous in thread | raw e-mail | index | archive | help
The comment and the code that rejects size=3D=3D0, or doesn't, are copied=

below.=A0 Konstantin Belousov is the last person to have touched most of
it, and can better explain its meaning than I.

Doug Moore

=A0=A0=A0 /*
=A0=A0=A0 =A0* Enforce the constraints.
=A0=A0=A0 =A0* Mapping of length 0 is only allowed for old binaries.
=A0=A0=A0 =A0* Anonymous mapping shall specify -1 as filedescriptor and
=A0=A0=A0 =A0* zero position for new code. Be nice to ancient a.out
=A0=A0=A0 =A0* binaries and correct pos for anonymous mapping, since old
=A0=A0=A0 =A0* ld.so sometimes issues anonymous map requests with non-zer=
o
=A0=A0=A0 =A0* pos.
=A0=A0=A0 =A0*/
=A0=A0=A0 if (!SV_CURPROC_FLAG(SV_AOUT)) {
=A0=A0=A0 =A0=A0=A0 if ((size =3D=3D 0 && curproc->p_osrel >=3D P_OSREL_M=
AP_ANON) ||
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 ((flags & MAP_ANON) !=3D 0 && (fd !=3D -1 |=
| pos !=3D 0)))
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 return (EINVAL);
=A0=A0=A0 } else {
=A0=A0=A0 =A0=A0=A0 if ((flags & MAP_ANON) !=3D 0)
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 pos =3D 0;
=A0=A0=A0 }

On 6/10/19 9:27 AM, Shawn Webb wrote:
> Sounds good! I think the manpage still might still need a change
> to match the current behavior, or perhaps matching something similar
> to that vm_mmap.c comment. But that comment brings another question:
> what's the definition of "old binaries"? a.out?
>
> Thanks,
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65cab520-731a-3256-8a71-bb8cfcc93011>