summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2017-09-12 02:56:55 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2017-09-12 02:56:55 +0000
commitc81d677be74b08137be2d3577c47fe7d375f8f5d (patch)
treedf0666bde1cf0838cc10eef0269f809e78ab536b /sys
parent430bfcc0dc1762cfa322df3d8b50b72ed951619b (diff)
add a guard page on the end of each threads kernel stack.
this protects the process control block. it also makes the kernel fault hard when the guard page gets hit by the stack, allowing debugging of the problem set of function calls at the time the problem occurs. without this, a big stack can overwrite the pcb, which makes the thread generate a fault when it is switched back onto a cpu, which is way too late. discussed with guenther@ ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/vm_machdep.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/vm_machdep.c b/sys/arch/amd64/amd64/vm_machdep.c
index b1080682907..432b8f9146e 100644
--- a/sys/arch/amd64/amd64/vm_machdep.c
+++ b/sys/arch/amd64/amd64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.38 2017/08/18 16:53:02 tom Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.39 2017/09/12 02:56:54 dlg Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */
/*-
@@ -152,11 +152,9 @@ cpu_exit(struct proc *p)
void
setredzone(struct proc *p)
{
-#if 0
pmap_remove(pmap_kernel(), (vaddr_t)p->p_addr + PAGE_SIZE,
(vaddr_t)p->p_addr + 2 * PAGE_SIZE);
pmap_update(pmap_kernel());
-#endif
}
/*