diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2002-12-02 09:00:27 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2002-12-02 09:00:27 +0000 |
commit | 22703df0df76accb65607f28070a9771b5bb42de (patch) | |
tree | 2f2aa0ebf948ee4580b10bb0a41b7f258b40d0e8 /gnu/usr.bin | |
parent | 560fab27442ac85618b1720e90581c295ae1ea83 (diff) |
Import propolice (http://www.trl.ibm.com/projects/security/ssp), a stack
attack protection scheme, into gcc.
This protection is enabled by default. It can be turned off by using the
-fno-stack-protector flag.
Code by Hiroaki Etoh (etoh at jp dot ibm dot com); work on openbsd-specific
integration by fgsch@, deraadt@ and myself; tests by fgsch@, naddy@ and
myself; beer drinking by myself.
Please note that system upgrades with this new code will require a new
libc and ld.so to be build and installed before the propolice-enabled
compiler can be installed.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index 0fb7e6184b8..f100fb1ae25 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld.c,v 1.29 2002/09/07 01:25:34 marc Exp $ */ +/* $OpenBSD: rtld.c,v 1.30 2002/12/02 09:00:11 miod Exp $ */ /* $NetBSD: rtld.c,v 1.43 1996/01/14 00:35:17 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -59,6 +59,18 @@ #include "ld.h" +/* + * Stack protector dummies. + * Ideally, a scheme to compile these stubs from libc should be used, but + * this would end up dragging too much code from libc here. + */ +long __guard[8] = {0,0,0,0,0,0,0,0}; +void +__stack_smash_handler(char func[], int damaged) +{ + _exit(127); +} + #ifndef MAP_ANON #define MAP_ANON 0 #define anon_open() do { \ |