From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: dma-mapping: don't allow DMA mappings to be marked executable
Date: Thu, 24 Oct 2013 11:14:09 +0100 [thread overview]
Message-ID: <1382609649.7602.26.camel@mbp> (raw)
In-Reply-To: <20131024093339.GF16735@n2100.arm.linux.org.uk>
On Thu, 2013-10-24 at 10:33 +0100, Russell King - ARM Linux wrote:
> On Thu, Oct 24, 2013 at 10:04:23AM +0100, Catalin Marinas wrote:
> > On Thu, 2013-10-24 at 08:05 +0100, Russell King - ARM Linux wrote:
> > > --- a/arch/arm/mm/dma-mapping.c
> > > +++ b/arch/arm/mm/dma-mapping.c
> > > @@ -688,7 +688,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);
> >
> > I think we lose the shareability attribute we add to pgprot_kernel when
> > SMP. So this creates a mismatched aliases and could have implications on
> > the barrier use (though I think we use the full system DSB in most cases
> > related to DMA). But architecturally I would feel better if we have the
> > same shareability domain.
>
> We don't.
>
> #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b))
>
> #define PAGE_KERNEL _MOD_PROT(pgprot_kernel, L_PTE_XN)
> #define PAGE_KERNEL_EXEC pgprot_kernel
>
> PAGE_KERNEL is used in generic code to setup kernel mappings by things
> like vmalloc() etc.
Ah, yes, it works correctly then.
--
Catalin
prev parent reply other threads:[~2013-10-24 10:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-24 7:05 [PATCH] ARM: dma-mapping: don't allow DMA mappings to be marked executable Russell King - ARM Linux
2013-10-24 9:04 ` Catalin Marinas
2013-10-24 9:33 ` Russell King - ARM Linux
2013-10-24 10:14 ` Catalin Marinas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1382609649.7602.26.camel@mbp \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).