From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 24 07:53:50 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DAF804EF for ; Thu, 24 Oct 2013 07:53:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79F4F223A for ; Thu, 24 Oct 2013 07:53:49 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r9O6rNNK052461; Thu, 24 Oct 2013 09:53:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r9O6rNNK052461 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r9O6rN8l052460; Thu, 24 Oct 2013 09:53:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Oct 2013 09:53:23 +0300 From: Konstantin Belousov To: d@delphij.net Subject: Re: FoxPro on FreeBSD Message-ID: <20131024065323.GA10625@kib.kiev.ua> References: <52687ED8.6080309@mindslayer.net> <9B89077C-6BE7-49F1-9F22-19FAD9F6C3ED@dragondata.com> <5268B62B.3000104@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <5268B62B.3000104@delphij.net> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: Puppet Master , "freebsd-hackers@freebsd.org Hackers" , Kevin Day X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Oct 2013 07:53:50 -0000 --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--