Subject: overflow in vmparam.h
To: None <port-i386@netbsd.org>
From: Castor Fu <castor@geocast.com>
List: port-i386
Date: 06/18/2000 10:36:43
In vmparam.h version 1.35 the following looks like an overflow
condition:


/* XXX max. amount of KVM to be used by buffers. */
#ifndef VM_MAX_KERNEL_BUF
#define VM_MAX_KERNEL_BUF \
        ((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) * 7 / 10)
#endif
   

We have ~1 gig of address space for KVM, so 1 gig * 7 wraps.
Any objections to:

#ifndef VM_MAX_KERNEL_BUF
#define VM_MAX_KERNEL_BUF \
        ((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 1024 * 7 / 10 * 1024)
#endif