Skip to content
Permalink
Browse files Browse the repository at this point in the history
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: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Oct 24, 2013
1 parent 59fd303 commit 0ea1ec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mm/dma-mapping.c
Expand Up @@ -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,
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;

if (dma_alloc_from_coherent(dev, size, handle, &memory))
Expand All @@ -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,
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;

if (dma_alloc_from_coherent(dev, size, handle, &memory))
Expand Down

0 comments on commit 0ea1ec7

Please sign in to comment.