All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gnu.org>
To: bug-hurd@gnu.org, grub-devel@gnu.org
Subject: Re: Stack protection via GCC's `-fstack-protector'
Date: Wed, 8 Nov 2006 23:36:20 +0100	[thread overview]
Message-ID: <20061108223620.GV32338@fencepost> (raw)
In-Reply-To: <20061108221419.GA19550@bouh.residence.ens-lyon.fr>

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

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?
> 
> 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 <stdio.h>
#include <stdlib.h>


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] ?: "<unknown>");
}
#v-


I'll give it a try.


Regards,
 Thomas

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-11-08 22:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08 21:40 Stack protection via GCC's `-fstack-protector' Thomas Schwinge
2006-11-08 22:14 ` Samuel Thibault
2006-11-08 22:36   ` Thomas Schwinge [this message]
2006-11-13 18:29     ` Thomas Schwinge
2006-11-13 18:44       ` Samuel Thibault
2006-11-08 22:36   ` Stefan Reinauer
2006-11-08 22:46     ` Samuel Thibault
2006-12-15 19:36 ` Thomas Schwinge
2007-02-03 11:40   ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061108223620.GV32338@fencepost \
    --to=tschwinge@gnu.org \
    --cc=bug-hurd@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.