diff options
author | rstone <rstone@FreeBSD.org> | 2015-09-17 23:31:44 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2015-09-17 23:31:44 +0000 |
commit | 26a0cf375aceedb2911b79b762cbc4f28510040a (patch) | |
tree | 0e2ce9e28f39248b1d87c63f4962c025c0735e6e /sys/sys/busdma_bufalloc.h | |
parent | a5578a13a31cb57fe230f49fe8e7f959295992cd (diff) | |
download | FreeBSD-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/sys/busdma_bufalloc.h')
-rw-r--r-- | sys/sys/busdma_bufalloc.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/sys/busdma_bufalloc.h b/sys/sys/busdma_bufalloc.h index f5ec32f..dfcb4b8 100644 --- a/sys/sys/busdma_bufalloc.h +++ b/sys/sys/busdma_bufalloc.h @@ -110,9 +110,10 @@ struct busdma_bufzone * busdma_bufalloc_findzone(busdma_bufalloc_t ba, * routines support pmap_page_set_memattr() and the VM_MEMATTR_UNCACHEABLE flag * you can probably use these when you need uncacheable buffers. */ -void * busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, int size, - u_int8_t *pflag, int wait); -void busdma_bufalloc_free_uncacheable(void *item, int size, u_int8_t pflag); +void * busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, vm_size_t size, + uint8_t *pflag, int wait); +void busdma_bufalloc_free_uncacheable(void *item, vm_size_t size, + uint8_t pflag); #endif /* _MACHINE_BUSDMA_BUFALLOC_H_ */ |