Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Oct 2013 09:53:23 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        d@delphij.net
Cc:        Puppet Master <pmaster@mindslayer.net>, "freebsd-hackers@freebsd.org Hackers" <freebsd-hackers@freebsd.org>, Kevin Day <toasty@dragondata.com>
Subject:   Re: FoxPro on FreeBSD
Message-ID:  <20131024065323.GA10625@kib.kiev.ua>
In-Reply-To: <5268B62B.3000104@delphij.net>
References:  <52687ED8.6080309@mindslayer.net> <9B89077C-6BE7-49F1-9F22-19FAD9F6C3ED@dragondata.com> <5268B62B.3000104@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Oct 23, 2013 at 10:54:51PM -0700, Xin Li wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>=20
> On 10/23/13, 8:32 PM, Kevin Day wrote:
> > I did some debugging, and watched how the process was getting
> > launched, and I've managed to get it to load!
> >=20
> > The problem was that COFF files expect to be mapped into memory at
> > address 0, something that processes are no longer allowed to do.
> >=20
> > Run "sysctl security.bsd.map_at_zero=3D1?  or add
> > ?security.bsd.map_at_zero=3D1? to /etc/sysctl.conf and you should
> > have it working. We probably should either make an exception for
> > COFF files to bypass this the sysctl restriction, or at least print
> > a more helpful error than just letting the process segfault because
> > it didn?t get mapped where it was supposed to go.
>=20
> Wow, this is impressive find, indeed!  Do they need to do the map at
> startup only, or do they want to explicitly map something at address 0
> during runtime?

How is this impressive ? Several variations of a.out and COFF binaries
are specified to start mapping of the text at 0.  This was one of the
reasons why I argued for sysctl to enable/disable mmap at zero by sysctl
instead of abruptly disallowing it, when corresponding 'security' feature
was discussed.

I documented the tuning needed to run a.out binaries in aout(4),
there are much more for it than just map at zero. If somebody wants to
provide similar hints for the COFF images, I cannot object.

--5mCyUwZo2JvN/JJP
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQIcBAEBAgAGBQJSaMPiAAoJEJDCuSvBvK1BclYP/iSVQHMQEkwlBQs2jopoMKhj
YZliOL2nz+lO/D6wfePkTOUbv1dmEhl/2tWl1bCpk9yN6KJuDOz2B6r6DVHA1c/j
/QjHB/OtkTOxQjw2lGG1j4eciG+TlDMUvtgRVmSr2g+nc7OLZmcjRZJdaR8LT/zv
2QMC/npZe3iffjKCK2j3LkT0Tn61/EiN3YpKOADyRQXQXHZ1x/fMvLFS9elOWHhm
Q5Xj9NV7OIeKieaHcnoVx6Im8mLa/UM7KdfhYcyVEyhURN5cAqUNqptlaTEgVchx
G32P8vCNwKK6IXGLEvtRGLVAIPkkVMtjkXHq3aiGBnHRgY59GNMyt6HhiRfH3Eqm
qGT4rlNGMjrwGL9TT4a93BATXR7P/odq79uId6b4nE8dxNMMxvN6NR4ZYE5afcP6
BFOQn9siL1h0s/SY1zN4+/O5Qlpuw4mQsgc4APLbUFkvFGKSW8ra95gJVtGComcX
LkAg1XrOwUDLBhzUiHGw83wcgKElAfgCt3fdaLdLxCnb/JU86zhKgZS360kBvJkS
e1LGOTHu+eWugRSDlKcdwxR+7tBFCEY5+rHruvDdULnZ90oulc2LZh9amwiw4dEP
6lGjdiARPlyWaycBWByGq+lsKo4nm2nm50WNDMKCecSck5H0qui3oR6pCn6Uvjme
c89AfTwpLylOjeVE326x
=WRUj
-----END PGP SIGNATURE-----

--5mCyUwZo2JvN/JJP--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131024065323.GA10625>