diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-21 21:24:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2020-10-21 21:24:58 +0000 |
commit | 325fea27bb3dab717d6604a27cb55bc3adb5e261 (patch) | |
tree | f8f7acaf158b8b824d3bfbb99f799e5edd527882 /sys | |
parent | a2de7f3318b02d0a355e4a16b1e66870a9179361 (diff) |
move the backwards-stack vm_minsaddr check from hppa trap.c to uvm_grow(),
within the correct #ifdef of course.
ok kettenis
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/trap.c | 5 | ||||
-rw-r--r-- | sys/uvm/uvm_unix.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 64879d4ddb0..9628cb45ed0 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.150 2020/10/08 19:41:04 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.151 2020/10/21 21:24:56 deraadt Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -498,8 +498,7 @@ datacc: * the current limit and we need to reflect that as an access * error. */ - if (ret == 0 && space != HPPA_SID_KERNEL && - va < (vaddr_t)vm->vm_minsaddr) + if (ret == 0 && space != HPPA_SID_KERNEL) uvm_grow(p, va); KERNEL_UNLOCK(); diff --git a/sys/uvm/uvm_unix.c b/sys/uvm/uvm_unix.c index 8f7ce154295..82617cb0595 100644 --- a/sys/uvm/uvm_unix.c +++ b/sys/uvm/uvm_unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_unix.c,v 1.70 2020/10/19 08:19:46 mpi Exp $ */ +/* $OpenBSD: uvm_unix.c,v 1.71 2020/10/21 21:24:57 deraadt Exp $ */ /* $NetBSD: uvm_unix.c,v 1.18 2000/09/13 15:00:25 thorpej Exp $ */ /* @@ -114,6 +114,10 @@ uvm_grow(struct proc *p, vaddr_t sp) /* For user defined stacks (from sendsig). */ if (sp < (vaddr_t)vm->vm_maxsaddr) return; +#ifdef MACHINE_STACK_GROWS_UP + if (sp >= (vaddr_t)vm->vm_minsaddr) + return; +#endif vm_map_lock(map); |