summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_param.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-08-16 13:04:21 +0000
committerkib <kib@FreeBSD.org>2012-08-16 13:04:21 +0000
commit0160404611cb531d1e5bfce344e466ceba0e73ab (patch)
tree2a76cc841c432c5e02dfd8db40a551857c96dcc0 /sys/kern/subr_param.c
parentee1919e40660334914107c2e926cf4b6d1fa615b (diff)
downloadFreeBSD-src-0160404611cb531d1e5bfce344e466ceba0e73ab.zip
FreeBSD-src-0160404611cb531d1e5bfce344e466ceba0e73ab.tar.gz
As a safety measure, disable lowering pid_max too much.
Requested by: Peter Jeremy <peter@rulingia.com> MFC after: 1 week
Diffstat (limited to 'sys/kern/subr_param.c')
-rw-r--r--sys/kern/subr_param.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
index 1c6b867..c4a566d 100644
--- a/sys/kern/subr_param.c
+++ b/sys/kern/subr_param.c
@@ -255,10 +255,13 @@ init_param1(void)
/*
* Only allow to lower the maximal pid.
+ * Prevent setting up a non-bootable system if pid_max is too low.
*/
TUNABLE_INT_FETCH("kern.pid_max", &pid_max);
if (pid_max > PID_MAX)
pid_max = PID_MAX;
+ else if (pid_max < 300)
+ pid_max = 300;
}
/*
OpenPOWER on IntegriCloud