From: Christoph Hellwig Date: Wed, 8 Sep 2021 02:56:04 +0000 (-0700) Subject: mm: don't allow executable ioremap mappings X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8491502f787c4a902bd4f223b578ef47d3490264;p=linux.git mm: don't allow executable ioremap mappings There is no need to execute from iomem (and most platforms it is impossible anyway), so add the pgprot_nx() call similar to vmap. Link: https://lkml.kernel.org/r/20210824091259.1324527-3-hch@lst.de Signed-off-by: Christoph Hellwig Cc: Nicholas Piggin Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e44983fb2d156..3055f04b486bb 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;