From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ghw1w-0004aA-Rh for mharc-grub-devel@gnu.org; Wed, 08 Nov 2006 17:36:24 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ghw1u-0004ZL-Uu for grub-devel@gnu.org; Wed, 08 Nov 2006 17:36:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ghw1u-0004Yh-6k for grub-devel@gnu.org; Wed, 08 Nov 2006 17:36:22 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ghw1s-0004WV-NH; Wed, 08 Nov 2006 17:36:20 -0500 Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Ghw1s-0007oL-Q0; Wed, 08 Nov 2006 17:36:20 -0500 Received: from tschwinge by fencepost.gnu.org with local (Exim 4.34) id 1Ghw1s-0004cS-3T; Wed, 08 Nov 2006 17:36:20 -0500 Date: Wed, 8 Nov 2006 23:36:20 +0100 From: Thomas Schwinge To: bug-hurd@gnu.org, grub-devel@gnu.org Message-ID: <20061108223620.GV32338@fencepost> References: <20061108214054.GU32338@fencepost> <20061108221419.GA19550@bouh.residence.ens-lyon.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8MA55IEjTDEadc2f" Content-Disposition: inline In-Reply-To: <20061108221419.GA19550@bouh.residence.ens-lyon.fr> X-Homepage: http://nic-nac-project.de/~schwinge/ User-Agent: Mutt/1.5.6+20040907i Cc: Subject: Re: Stack protection via GCC's `-fstack-protector' X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2006 22:36:23 -0000 --8MA55IEjTDEadc2f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello! On Wed, Nov 08, 2006 at 11:14:19PM +0100, Samuel Thibault wrote: > Thomas Schwinge, le Wed 08 Nov 2006 22:40:54 +0100, a ?crit : > > Is it feasible to have the `-fstack-protector' functionality in GNU Mach > > and GRUB2 (and how to do that, then) or shall we unconditionally pass > > `-fno-stack-protector' if available? >=20 > I'd say it shouldn't be very hard to provide a stack_chk_fail function, > even if all it does is just panic(). Having had a look at glibc's implementation and its complexity ;-) that might indeed be a reachable goal (assuming that no other surprises show up): debug/stack_chk_fail.c #v+ [Copyright header.] #include #include extern char **__libc_argv attribute_hidden; void __attribute__ ((noreturn)) __stack_chk_fail (void) { /* The loop is added only to keep gcc happy. */ while (1) __libc_message (1, "*** stack smashing detected ***: %s terminated\n", __libc_argv[0] ?: ""); } #v- I'll give it a try. Regards, Thomas --8MA55IEjTDEadc2f Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFFUlvkgfzh735dTTURAlMZAJ9OmbEbdtJEALxDPRroh0C5JhIS7wCdEtdT VlS8nkvv6IHt38qToluN0jY= =y7Pq -----END PGP SIGNATURE----- --8MA55IEjTDEadc2f--