aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_malloc.c
diff options
context:
space:
mode:
authorMatthew D Fleming <mdf@FreeBSD.org>2012-07-15 20:29:48 +0000
committerMatthew D Fleming <mdf@FreeBSD.org>2012-07-15 20:29:48 +0000
commitf806cdcf9939339b794c22c62e9d9ac7e9f06027 (patch)
tree2a0f83e86809435c7447ffbd609f73783ac90342 /sys/kern/kern_malloc.c
parent5e20b91dbeba38dc715d5b42fa2b064c13a9750b (diff)
downloadsrc-f806cdcf9939339b794c22c62e9d9ac7e9f06027.tar.gz
src-f806cdcf9939339b794c22c62e9d9ac7e9f06027.zip
Fix a bug with memguard(9) on 32-bit architectures without a
VM_KMEM_MAX_SIZE. The code was not taking into account the size of the kernel_map, which the kmem_map is allocated from, so it could produce a sub-map size too large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely and base the memguard map's size off the kernel_map's size, since this is always relevant and always smaller. Found by: Justin Hibbits
Notes
Notes: svn path=/head/; revision=238502
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r--sys/kern/kern_malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 18428c0dfdfe..e06fa59bd7e5 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -744,7 +744,7 @@ kmeminit(void *dummy)
vm_kmem_size = 2 * mem_size * PAGE_SIZE;
#ifdef DEBUG_MEMGUARD
- tmp = memguard_fudge(vm_kmem_size, vm_kmem_size_max);
+ tmp = memguard_fudge(vm_kmem_size, kernel_map);
#else
tmp = vm_kmem_size;
#endif