summaryrefslogtreecommitdiff
path: root/sys/conf/param.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2019-07-16 17:39:03 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2019-07-16 17:39:03 +0000
commit716390e11ca954de06a17e8487826770e28a5f61 (patch)
tree4c4b56986a54d02748831471daff2f5f393877a8 /sys/conf/param.c
parent292f00b5dfee28e944ab604d380cecfa68fea83b (diff)
Prevent integer overflow in kernel and userland when checking mbuf
limits. Convert kernel variables and calculations for mbuf memory into long to allow larger values on 64 bit machines. Put a range check into the kernel sysctl. For the interface itself int is still sufficient. In netstat -m cast all multiplications to unsigned long to hold the product of two unsigned int. input and OK visa@
Diffstat (limited to 'sys/conf/param.c')
-rw-r--r--sys/conf/param.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/conf/param.c b/sys/conf/param.c
index 28b54ba5bfd..b25e1995e90 100644
--- a/sys/conf/param.c
+++ b/sys/conf/param.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.c,v 1.41 2019/07/08 23:59:32 mlarkin Exp $ */
+/* $OpenBSD: param.c,v 1.42 2019/07/16 17:39:02 bluhm Exp $ */
/* $NetBSD: param.c,v 1.16 1996/03/12 03:08:40 mrg Exp $ */
/*
@@ -89,7 +89,7 @@ int initialvnodes = NVNODE;
int maxprocess = NPROCESS;
int maxthread = NPROCESS + 8 * MAXUSERS;
int maxfiles = 5 * (NPROCESS + MAXUSERS) + 80;
-int nmbclust = NMBCLUSTERS;
+long nmbclust = NMBCLUSTERS;
#ifndef MBLOWAT
#define MBLOWAT 16