summaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2017-07-06 15:36:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 16:24:31 -0700
commitac34ceaf1cdb34e8c34c0873ee562e9df6087cbc (patch)
treef06d0c4f732aabe00f879dfb0a33b2d9ada3beae /mm/mmap.c
parentc4e1be9ec1130fff4d691cdc0e0f9d666009f9ae (diff)
downloadop-kernel-dev-ac34ceaf1cdb34e8c34c0873ee562e9df6087cbc.zip
op-kernel-dev-ac34ceaf1cdb34e8c34c0873ee562e9df6087cbc.tar.gz
mm/mmap.c: mark protection_map as __ro_after_init
The protection map is only modified by per-arch init code so it can be protected from writes after the init code runs. This change was extracted from PaX where it's part of KERNEXEC. Link: http://lkml.kernel.org/r/20170510174441.26163-1-danielmicay@gmail.com Signed-off-by: Daniel Micay <danielmicay@gmail.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index a5e3dcd..5a0ba97 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -94,7 +94,7 @@ static void unmap_region(struct mm_struct *mm,
* w: (no) no
* x: (yes) yes
*/
-pgprot_t protection_map[16] = {
+pgprot_t protection_map[16] __ro_after_init = {
__P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111,
__S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
};
OpenPOWER on IntegriCloud