diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-03-31 22:16:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-03-31 22:16:49 +0000 |
commit | 03bb1e176989d512179693e2f030435a53c9bb0c (patch) | |
tree | bb9a40e19759dfcba97289d8f5c4e079d5c1370c /sys | |
parent | 34e7f54cc6ad76ed00938fca4c44600f76fbdbb5 (diff) |
do nbuf constraint based on KERNEND/KERNBASE to avoid integer overflow from new giant sparc64 kvm; ok kettenis, tested by pooleb
Diffstat (limited to 'sys')
-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. */ |