]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: cma: fix incorrect type conversion for size during dma allocation
authorRohit Vaswani <rvaswani@codeaurora.org>
Thu, 22 Oct 2015 20:32:11 +0000 (13:32 -0700)
committerBrian Maly <brian.maly@oracle.com>
Wed, 2 Jan 2019 18:10:26 +0000 (13:10 -0500)
commit53a251333c31adae7ff422824a9ae351e77a0e7b
tree7d2bf138502db3607a9c13f0a1d0a6027bc24511
parent1595b274da51609255e6d5c0a735a3796b103c6e
mm: cma: fix incorrect type conversion for size during dma allocation

This was found during userspace fuzzing test when a large size dma cma
allocation is made by driver(like ion) through userspace.

  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

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 67a2e213e7e937c41c52ab5bc46bf3f4de469f6e)

Orabug: 28407826
CVE: CVE-2017-9725

Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/base/dma-contiguous.c
include/linux/cma.h
include/linux/dma-contiguous.h
mm/cma.c