LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Nicholas Piggin <npiggin@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] mm: don't allow executable ioremap mappings
Date: Tue, 24 Aug 2021 11:12:59 +0200 [thread overview]
Message-ID: <20210824091259.1324527-3-hch@lst.de> (raw)
In-Reply-To: <20210824091259.1324527-1-hch@lst.de>
There is no need to execute from iomem (and most platforms it is
impossible anyway), so add the pgprot_nx() call similar to vmap.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/vmalloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index e44983fb2d15..3055f04b486b 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -316,7 +316,7 @@ int ioremap_page_range(unsigned long addr, unsigned long end,
{
int err;
- err = vmap_range_noflush(addr, end, phys_addr, prot,
+ err = vmap_range_noflush(addr, end, phys_addr, pgprot_nx(prot),
ioremap_max_page_shift);
flush_cache_vmap(addr, end);
return err;
--
2.30.2
next prev parent reply other threads:[~2021-08-24 9:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-24 9:12 small ioremap cleanups Christoph Hellwig
2021-08-24 9:12 ` [PATCH 1/2] mm: move ioremap_page_range to vmalloc.c Christoph Hellwig
2021-08-24 19:51 ` kernel test robot
2021-08-26 2:36 ` Nicholas Piggin
2021-08-24 9:12 ` Christoph Hellwig [this message]
2021-08-26 2:46 ` [PATCH 2/2] mm: don't allow executable ioremap mappings Nicholas Piggin
2021-08-26 5:37 ` Christoph Hellwig
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=20210824091259.1324527-3-hch@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--subject='Re: [PATCH 2/2] mm: don'\''t allow executable ioremap mappings' \
/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
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).