summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-08-24 22:45:30 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-08-24 22:45:30 +0000
commit64e1c69ccd4bc6743c9900a2501fb2b4f5b4e764 (patch)
tree3c8e1e25ad21da0609ae8f69f1138067bf88f57b /sys/uvm
parent79ff2e1a25b342d4c81ef87ee4fe2dfa7b061640 (diff)
Properly check for VM_MAX_KERNEL_ADDRESS wraparound in the guard pages code.
ok ariane@
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 938fb3edd16..405c3371263 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.121 2009/08/13 20:40:13 ariane Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.122 2009/08/24 22:45:29 miod Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -742,7 +742,7 @@ uvm_map_p(struct vm_map *map, vaddr_t *startp, vsize_t size,
* Try to fully exhaust kva prior to wrap-around.
* (This may eat your ram!)
*/
- if (VM_MAX_KERNEL_ADDRESS < (kva_guardstart + size)) {
+ if (VM_MAX_KERNEL_ADDRESS - kva_guardstart < size) {
static int wrap_counter = 0;
printf("uvm_map: kva guard page wrap-around %d\n",
++wrap_counter);