diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-01-20 19:43:22 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-01-20 19:43:22 +0000 |
commit | 843caa662411e1f3f1e091acabce370c6a712e79 (patch) | |
tree | 5d68f36941775458a22730ff493a8a3c35ae9f91 /sys/arch | |
parent | b210c6a192929f24e3f8117e2f39fd32bf98e86c (diff) |
Move ps_strings "after" the random stackgap. This makes its location a
per-process value, and therefpore turns the VM_PSSTRINGS sysctl into a
per-process one as well. This gets rid of a pointer to the bottom of the
stack at a fixed location. Also clears the road for unmapping the stackgap.
ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/sh/sh/sh_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/vax/trap.c | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index e80132b3091..aaf508e6fd7 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.240 2014/12/10 15:29:53 mikeb Exp $ */ +/* $OpenBSD: machdep.c,v 1.241 2015/01/20 19:43:20 kettenis Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -1165,7 +1165,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, tf->tf_iioq_head = pack->ep_entry | HPPA_PC_PRIV_USER; tf->tf_iioq_tail = tf->tf_iioq_head + 4; tf->tf_iisq_head = tf->tf_iisq_tail = pcb->pcb_space; - tf->tf_arg0 = (u_long)PS_STRINGS; + tf->tf_arg0 = p->p_p->ps_strings; /* setup terminal stack frame */ setstack(tf, (stack + 0x3f) & ~0x3f, 0); diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c index a7fc998040b..deda6e98f78 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.76 2014/12/10 15:29:53 mikeb Exp $ */ +/* $OpenBSD: machdep.c,v 1.77 2015/01/20 19:43:20 kettenis Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -808,7 +808,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, tf->tf_iioq[1] = 4 + (tf->tf_iioq[0] = pack->ep_entry | HPPA_PC_PRIV_USER); tf->tf_rp = 0; - tf->tf_args[0] = (u_long)PS_STRINGS; + tf->tf_args[0] = p->p_p->ps_strings; tf->tf_args[1] = tf->tf_args[2] = 0; /* XXX dynload stuff */ /* setup terminal stack frame */ diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index bb8cc6664a7..f5920e352d3 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.563 2015/01/19 16:01:44 jsg Exp $ */ +/* $OpenBSD: machdep.c,v 1.564 2015/01/20 19:43:21 kettenis Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -2895,7 +2895,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, tf->tf_edi = 0; tf->tf_esi = 0; tf->tf_ebp = 0; - tf->tf_ebx = (int)PS_STRINGS; + tf->tf_ebx = (int)p->p_p->ps_strings; tf->tf_edx = 0; tf->tf_ecx = 0; tf->tf_eax = 0; diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index 7b712b82153..69e864fed4a 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.166 2015/01/20 18:34:00 mpi Exp $ */ +/* $OpenBSD: machdep.c,v 1.167 2015/01/20 19:43:21 kettenis Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -503,7 +503,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, pargs = -roundup(-stack + 8, 16); newstack = (u_int32_t)(pargs - 32); - copyin ((void *)(VM_MAX_ADDRESS-0x10), &args, 0x10); + copyin ((void *)p->p_p->ps_strings, &args, 0x10); bzero(tf, sizeof *tf); tf->fixreg[1] = newstack; diff --git a/sys/arch/sh/sh/sh_machdep.c b/sys/arch/sh/sh/sh_machdep.c index ccf4468d05c..d8eccbfccae 100644 --- a/sys/arch/sh/sh/sh_machdep.c +++ b/sys/arch/sh/sh/sh_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sh_machdep.c,v 1.37 2014/05/08 21:43:04 miod Exp $ */ +/* $OpenBSD: sh_machdep.c,v 1.38 2015/01/20 19:43:21 kettenis Exp $ */ /* $NetBSD: sh3_machdep.c,v 1.59 2006/03/04 01:13:36 uwe Exp $ */ /* @@ -581,7 +581,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, tf->tf_r6 = stack + 4 * tf->tf_r4 + 8; /* envp */ tf->tf_r7 = 0; tf->tf_r8 = 0; - tf->tf_r9 = (int)PS_STRINGS; + tf->tf_r9 = (int)p->p_p->ps_strings; tf->tf_r10 = 0; tf->tf_r11 = 0; tf->tf_r12 = 0; diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index 7260b4ec777..d74d65d75e8 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.54 2014/11/16 12:30:59 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.55 2015/01/20 19:43:21 kettenis Exp $ */ /* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -309,7 +309,7 @@ setregs(p, pack, stack, retval) exptr->r6 = stack; /* for ELF */ exptr->r7 = 0; /* for ELF */ exptr->r8 = 0; /* for ELF */ - exptr->r9 = (u_long) PS_STRINGS; /* for ELF */ + exptr->r9 = p->p_p->ps_strings; /* for ELF */ retval[1] = 0; } |