From 26a0cf375aceedb2911b79b762cbc4f28510040a Mon Sep 17 00:00:00 2001 From: rstone Date: Thu, 17 Sep 2015 23:31:44 +0000 Subject: 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. --- sys/mips/mips/uma_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/mips') diff --git a/sys/mips/mips/uma_machdep.c b/sys/mips/mips/uma_machdep.c index 1c8e6c8..a1f5e5f 100644 --- a/sys/mips/mips/uma_machdep.c +++ b/sys/mips/mips/uma_machdep.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include void * -uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) +uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_int8_t *flags, int wait) { vm_paddr_t pa; vm_page_t m; @@ -70,7 +70,7 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) } void -uma_small_free(void *mem, int size, u_int8_t flags) +uma_small_free(void *mem, vm_size_t size, u_int8_t flags) { vm_page_t m; vm_paddr_t pa; -- cgit v1.1