summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_vmem.c
diff options
context:
space:
mode:
authorrstone <rstone@FreeBSD.org>2015-09-17 23:31:44 +0000
committerrstone <rstone@FreeBSD.org>2015-09-17 23:31:44 +0000
commit26a0cf375aceedb2911b79b762cbc4f28510040a (patch)
tree0e2ce9e28f39248b1d87c63f4962c025c0735e6e /sys/kern/subr_vmem.c
parenta5578a13a31cb57fe230f49fe8e7f959295992cd (diff)
downloadFreeBSD-src-26a0cf375aceedb2911b79b762cbc4f28510040a.zip
FreeBSD-src-26a0cf375aceedb2911b79b762cbc4f28510040a.tar.gz
MFC r280957
Fix integer truncation bug in malloc(9) A couple of internal functions used by malloc(9) and uma truncated a size_t down to an int. This could cause any number of issues (e.g. indefinite sleeps, memory corruption) if any kernel subsystem tried to allocate 2GB or more through malloc. zfs would attempt such an allocation when run on a system with 2TB or more of RAM.
Diffstat (limited to 'sys/kern/subr_vmem.c')
-rw-r--r--sys/kern/subr_vmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_vmem.c b/sys/kern/subr_vmem.c
index 8cc020a..389b7ee 100644
--- a/sys/kern/subr_vmem.c
+++ b/sys/kern/subr_vmem.c
@@ -608,7 +608,7 @@ static struct mtx_padalign vmem_bt_lock;
* we are really out of KVA.
*/
static void *
-vmem_bt_alloc(uma_zone_t zone, int bytes, uint8_t *pflag, int wait)
+vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t *pflag, int wait)
{
vmem_addr_t addr;
OpenPOWER on IntegriCloud