Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac34ceaf authored by Daniel Micay's avatar Daniel Micay Committed by Linus Torvalds
Browse files

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: default avatarDaniel Micay <danielmicay@gmail.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c4e1be9e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
};