From e1ebcf0a5fe6de93393984e5eeb95ddd24be9cce Mon Sep 17 00:00:00 2001 From: Maggie White Date: Wed, 5 Jul 2017 16:47:15 -0700 Subject: mm: Fix incorrect type conversion for size during dma allocation This was found during userspace fuzzing test when a large size allocation is made from ion [] show_stack+0x10/0x1c [] dump_stack+0x74/0xc8 [] kasan_report_error+0x2b0/0x408 [] kasan_report+0x34/0x40 [] __asan_storeN+0x15c/0x168 [] memset+0x20/0x44 [] __dma_alloc_coherent+0x114/0x18c [] __dma_alloc_noncoherent+0xbc/0x19c [] ion_cma_allocate+0x178/0x2f0 [] ion_secure_cma_allocate+0xdc/0x190 [] ion_alloc+0x264/0xb88 [] ion_ioctl+0x1f4/0x480 [] do_vfs_ioctl+0x67c/0x764 [] SyS_ioctl+0x58/0x8c Bug: 38195738 Signed-off-by: Rohit Vaswani Signed-off-by: Maggie White Change-Id: I6b1a0a3eaec10500cd4e73290efad4023bc83da5 --- include/linux/dma-contiguous.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/dma-contiguous.h') diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h index c6d18f9d5..425160387 100644 --- a/include/linux/dma-contiguous.h +++ b/include/linux/dma-contiguous.h @@ -128,7 +128,7 @@ static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size, } #endif -struct page *dma_alloc_from_contiguous(struct device *dev, int count, +struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, unsigned int order); bool dma_release_from_contiguous(struct device *dev, struct page *pages, int count); @@ -168,7 +168,7 @@ int dma_declare_contiguous(struct device *dev, phys_addr_t size, } static inline -struct page *dma_alloc_from_contiguous(struct device *dev, int count, +struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, unsigned int order) { return NULL; -- cgit v1.2.3