From: deraadt Date: Fri, 15 Dec 1995 02:25:39 +0000 (+0000) Subject: clamp maxproc to not exceed pt space X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a2fe33404146426e1a7690061969a6457a791670;p=openbsd clamp maxproc to not exceed pt space --- 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)