summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2004-05-23 02:59:05 +0000
committerderaadt <deraadt@openbsd.org>2004-05-23 02:59:05 +0000
commitc2669961ad3eac0723645a9e3be02f6ff7e76ed5 (patch)
tree355aa7759a58f1db45276daa24b7bfcc7ffb77e5
parentehci man pages before src (diff)
downloadwireguard-openbsd-c2669961ad3eac0723645a9e3be02f6ff7e76ed5.tar.xz
wireguard-openbsd-c2669961ad3eac0723645a9e3be02f6ff7e76ed5.zip
Three years ago, Mike Frantzen invented StackGhost -- a simple tweak
to the register window spill/fill routines which made buffer overflows much more difficult to exploit. This code was integrated (and optimized) into OpenBSD/sparc, but could not be enabled because the interface changes affected gdb deeply. Mike and I (independently) failed to write gdb support, so StackGhost was left disabled. Until today, two years later.. because Mark Kettenis has written the neccessary code! Here comes the 1 line diff that enables StackGhost! Thanks Mark!
-rw-r--r--sys/arch/sparc/sparc/machdep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 03f9989c08f..c4fdc2e74d8 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.98 2004/03/10 23:02:54 tom Exp $ */
+/* $OpenBSD: machdep.c,v 1.99 2004/05/23 02:59:05 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -356,7 +356,7 @@ setregs(p, pack, stack, retval)
/* Setup the process StackGhost cookie which will be XORed into
* the return pointer as register windows are over/underflowed
*/
- p->p_addr->u_pcb.pcb_wcookie = 0; /* XXX later arc4random(); */
+ p->p_addr->u_pcb.pcb_wcookie = arc4random();
/* The cookie needs to guarantee invalid alignment after the XOR */
switch (p->p_addr->u_pcb.pcb_wcookie % 3) {