diff options
author | Ryan Stone <rstone@FreeBSD.org> | 2015-04-01 12:42:26 +0000 |
---|---|---|
committer | Ryan Stone <rstone@FreeBSD.org> | 2015-04-01 12:42:26 +0000 |
commit | f2c2231e0c55b53a044f36aec2941b157cefce4a (patch) | |
tree | a5f9ea26e9cde6035646a47810b3727348fe048b /sys/sparc64 | |
parent | 7dce9b515b54dfb62c8ad4a9d0c8ab3139b15233 (diff) | |
download | src-f2c2231e0c55b53a044f36aec2941b157cefce4a.tar.gz src-f2c2231e0c55b53a044f36aec2941b157cefce4a.zip |
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.
Note to self: When this is MFCed, sparc64 needs the same fix.
Differential revision: https://reviews.freebsd.org/D2106
Reviewed by: kib
Reported by: Michael Fuckner <michael@fuckner.net>
Tested by: Michael Fuckner <michael@fuckner.net>
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=280957
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/vm_machdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c index df184fa418bb..df8be0b4e0c2 100644 --- a/sys/sparc64/sparc64/vm_machdep.c +++ b/sys/sparc64/sparc64/vm_machdep.c @@ -396,7 +396,7 @@ swi_vm(void *v) } 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; @@ -434,7 +434,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; |