Skip to content

Commit f596ded

Browse files
chleroytorvalds
authored andcommitted
init/main.c: fix misleading "This architecture does not have kernel memory protection" message
This message leads to thinking that memory protection is not implemented for the said architecture, whereas absence of CONFIG_STRICT_KERNEL_RWX only means that memory protection has not been selected at compile time. Don't print this message when CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is selected by the architecture. Instead, print "Kernel memory protection not selected by kernel config." Link: http://lkml.kernel.org/r/62477e446d9685459d4f27d193af6ff1bd69d55f.1578557581.git.christophe.leroy@c-s.fr Signed-off-by: Christophe Leroy <[email protected]> Acked-by: Kees Cook <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Michael Ellerman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 283900e commit f596ded

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

init/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,11 @@ static void mark_readonly(void)
11041104
} else
11051105
pr_info("Kernel memory protection disabled.\n");
11061106
}
1107+
#elif defined(CONFIG_ARCH_HAS_STRICT_KERNEL_RWX)
1108+
static inline void mark_readonly(void)
1109+
{
1110+
pr_warn("Kernel memory protection not selected by kernel config.\n");
1111+
}
11071112
#else
11081113
static inline void mark_readonly(void)
11091114
{

0 commit comments

Comments
 (0)