Commit 0ea1ec71 authored by Russell King's avatar Russell King

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

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>
parent 59fd3033
...@@ -687,7 +687,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, ...@@ -687,7 +687,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
gfp_t gfp, struct dma_attrs *attrs) gfp_t gfp, struct dma_attrs *attrs)
{ {
pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel); pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
void *memory; void *memory;
if (dma_alloc_from_coherent(dev, size, handle, &memory)) if (dma_alloc_from_coherent(dev, size, handle, &memory))
...@@ -700,7 +700,7 @@ void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, ...@@ -700,7 +700,7 @@ void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
static void *arm_coherent_dma_alloc(struct device *dev, size_t size, static void *arm_coherent_dma_alloc(struct device *dev, size_t size,
dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs) dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs)
{ {
pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel); pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
void *memory; void *memory;
if (dma_alloc_from_coherent(dev, size, handle, &memory)) if (dma_alloc_from_coherent(dev, size, handle, &memory))
......
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