summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-05-23 02:59:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-05-23 02:59:06 +0000
commit9a602279ea7954459111471ffe3834823a8b9685 (patch)
treef64e855176427988eb57213d8ada9a0c40eef312 /sys
parentbdf6ac1f7bfa48f06f3b6f3cfe8b0f6be4ad9d66 (diff)
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!
Diffstat (limited to 'sys')
-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) {