diff options
author | 2007-03-31 22:16:48 +0000 | |
---|---|---|
committer | 2007-03-31 22:16:48 +0000 | |
commit | a8cdbc49eb234f050dd4149d925b1eea3163f345 (patch) | |
tree | 4e89a8371aaf4499e7320624bb240fbe3f866c88 | |
parent | Map PCIe config space. (diff) | |
download | wireguard-openbsd-a8cdbc49eb234f050dd4149d925b1eea3163f345.tar.xz wireguard-openbsd-a8cdbc49eb234f050dd4149d925b1eea3163f345.zip |
do nbuf constraint based on KERNEND/KERNBASE to avoid integer overflow from new giant sparc64 kvm; ok kettenis, tested by pooleb
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index b527f2bc3e7..faf51063204 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.86 2006/12/30 16:25:41 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.87 2007/03/31 22:16:48 deraadt Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -364,8 +364,8 @@ allocsys(caddr_t v) } /* Restrict to at most 30% filled kvm */ if (nbuf * MAXBSIZE > - (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) * 3 / 10) - nbuf = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / + (KERNEND - KERNBASE) * 3 / 10) + nbuf = (KERNEND - KERNBASE) / MAXBSIZE * 3 / 10; /* More buffer pages than fits into the buffers is senseless. */ |