From 391bb65d1496c86e2d14901828237ae47d80c02c Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 27 Feb 1998 19:58:29 +0000 Subject: [PATCH] Raise ncallout from NPROC + 16 to NPROC + 16 + MAXFILES. This shold prevent a possible DOS attack. The proper fix (to dynamically grow the callout list) is in the make. Submitted by: Paul Traina --- sys/conf/param.c | 9 +++++---- sys/kern/subr_param.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/conf/param.c b/sys/conf/param.c index 3aa4e7db5140..b38edcc27541 100644 --- a/sys/conf/param.c +++ b/sys/conf/param.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.c 8.3 (Berkeley) 8/20/94 - * $Id: param.c,v 1.24 1997/02/22 09:28:15 peter Exp $ + * $Id: param.c,v 1.25 1997/06/14 11:38:46 bde Exp $ */ #include "opt_sysvipc.h" @@ -72,11 +72,12 @@ int hz = HZ; int tick = 1000000 / HZ; int tickadj = 30000 / (60 * HZ); /* can adjust 30ms in 60s */ #define NPROC (20 + 16 * MAXUSERS) +#define MAXFILES (NPROC*2) int maxproc = NPROC; /* maximum # of processes */ int maxprocperuid = NPROC-1; /* maximum # of processes per user */ -int maxfiles = NPROC*2; /* system wide open files limit */ -int maxfilesperproc = NPROC*2; /* per-process open files limit */ -int ncallout = 16 + NPROC; /* maximum # of timer events */ +int maxfiles = MAXFILES; /* system wide open files limit */ +int maxfilesperproc = MAXFILES; /* per-process open files limit */ +int ncallout = 16 + NPROC + MAXFILES; /* maximum # of timer events */ /* maximum # of mbuf clusters */ #ifndef NMBCLUSTERS diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 3aa4e7db5140..b38edcc27541 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.c 8.3 (Berkeley) 8/20/94 - * $Id: param.c,v 1.24 1997/02/22 09:28:15 peter Exp $ + * $Id: param.c,v 1.25 1997/06/14 11:38:46 bde Exp $ */ #include "opt_sysvipc.h" @@ -72,11 +72,12 @@ int hz = HZ; int tick = 1000000 / HZ; int tickadj = 30000 / (60 * HZ); /* can adjust 30ms in 60s */ #define NPROC (20 + 16 * MAXUSERS) +#define MAXFILES (NPROC*2) int maxproc = NPROC; /* maximum # of processes */ int maxprocperuid = NPROC-1; /* maximum # of processes per user */ -int maxfiles = NPROC*2; /* system wide open files limit */ -int maxfilesperproc = NPROC*2; /* per-process open files limit */ -int ncallout = 16 + NPROC; /* maximum # of timer events */ +int maxfiles = MAXFILES; /* system wide open files limit */ +int maxfilesperproc = MAXFILES; /* per-process open files limit */ +int ncallout = 16 + NPROC + MAXFILES; /* maximum # of timer events */ /* maximum # of mbuf clusters */ #ifndef NMBCLUSTERS