summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-15 02:25:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-15 02:25:40 +0000
commit504c01c896b6886c68ac1635d66336ccbe4a4e2b (patch)
tree963bd7f7c2df2b39dee35a644c618bd844756921 /sys/arch/mvme68k
parenta215e357f13619b1cb8952e66d1006752e813e54 (diff)
clamp maxproc to not exceed pt space
Diffstat (limited to 'sys/arch/mvme68k')
-rw-r--r--sys/arch/mvme68k/mvme68k/pmap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/mvme68k/mvme68k/pmap.c b/sys/arch/mvme68k/mvme68k/pmap.c
index d1bc4bf8819..8860f17b7b3 100644
--- a/sys/arch/mvme68k/mvme68k/pmap.c
+++ b/sys/arch/mvme68k/mvme68k/pmap.c
@@ -1,4 +1,4 @@
-/* $Id: pmap.c,v 1.3 1995/11/28 20:43:19 deraadt Exp $ */
+/* $Id: pmap.c,v 1.4 1995/12/15 02:25:39 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -474,7 +474,17 @@ bogons:
* map where we want it.
*/
addr = M68K_PTBASE;
- s = min(M68K_PTMAXSIZE, maxproc*M68K_MAX_PTSIZE);
+ if ((M68K_PTMAXSIZE / M68K_MAX_PTSIZE) < maxproc) {
+ s = M68K_PTMAXSIZE;
+ /*
+ * XXX We don't want to hang when we run out of
+ * page tables, so we lower maxproc so that fork()
+ * will fail instead. Note that root could still raise
+ * this value via sysctl(2).
+ */
+ maxproc = (M68K_PTMAXSIZE / M68K_MAX_PTSIZE);
+ } else
+ s = (maxproc * M68K_MAX_PTSIZE);
addr2 = addr + s;
rv = vm_map_find(kernel_map, NULL, 0, &addr, s, TRUE);
if (rv != KERN_SUCCESS)