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
signature.asc
Description: Digital signature
_______________________________________________ Grub-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/grub-devel
