Commit d05fedab authored by Russell King's avatar Russell King Committed by Ben Hutchings

ARM: dma-mapping: don't allow DMA mappings to be marked executable

commit 0ea1ec71 upstream.

DMA mapping permissions were being derived from pgprot_kernel directly
without using PAGE_KERNEL.  This causes them to be marked with executable
permission, which is not what we want.  Fix this.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 3e21b29f
...@@ -374,7 +374,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gf ...@@ -374,7 +374,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gf
return memory; return memory;
return __dma_alloc(dev, size, handle, gfp, return __dma_alloc(dev, size, handle, gfp,
pgprot_dmacoherent(pgprot_kernel)); pgprot_dmacoherent(PAGE_KERNEL));
} }
EXPORT_SYMBOL(dma_alloc_coherent); EXPORT_SYMBOL(dma_alloc_coherent);
...@@ -386,7 +386,7 @@ void * ...@@ -386,7 +386,7 @@ void *
dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
{ {
return __dma_alloc(dev, size, handle, gfp, return __dma_alloc(dev, size, handle, gfp,
pgprot_writecombine(pgprot_kernel)); pgprot_writecombine(PAGE_KERNEL));
} }
EXPORT_SYMBOL(dma_alloc_writecombine); EXPORT_SYMBOL(dma_alloc_writecombine);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment