From 6504d21c450a5c38d48c6e890e500cffa27fb827 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 26 Oct 2003 22:31:24 +0000 Subject: per deraadt@ request, don't permit insanely large stackgap values. --- sys/kern/kern_sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_sysctl.c') diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 0dee4aaf506..0af58239e6f 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.90 2003/10/24 19:05:21 tedu Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.91 2003/10/26 22:31:23 tedu Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -447,7 +447,7 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) * Safety harness. */ if ((stackgap < ALIGNBYTES && stackgap != 0) || - !powerof2(stackgap)) + !powerof2(stackgap) || stackgap >= 256 * 1024 * 1024) return (EINVAL); stackgap_random = stackgap; return (0); -- cgit v1.2.3