dma-mapping: check pfn validity in dma_common_{mmap,get_sgtable}
authorChristoph Hellwig <hch@lst.de>
Mon, 8 Jul 2019 18:51:56 +0000 (11:51 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 24 Jul 2019 15:28:54 +0000 (17:28 +0200)
commit66d7780f18eae0232827fcffeaded39a6a168236
tree78bb0a0a0f8a11384dea615cc845185162ea531a
parent06532750010e06dd4b6d69983773677df7fc5291
dma-mapping: check pfn validity in dma_common_{mmap,get_sgtable}

Check that the pfn returned from arch_dma_coherent_to_pfn refers to
a valid page and reject the mmap / get_sgtable requests otherwise.

Based on the arm implementation of the mmap and get_sgtable methods.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Vignesh Raghavendra <vigneshr@ti.com>
kernel/dma/mapping.c