Skip to content

Commit

Permalink
init/main.c: fix misleading "This architecture does not have kernel m…
Browse files Browse the repository at this point in the history
…emory 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]>
  • Loading branch information
chleroy authored and torvalds committed Jan 31, 2020
1 parent 283900e commit f596ded
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,11 @@ static void mark_readonly(void)
} else
pr_info("Kernel memory protection disabled.\n");
}
#elif defined(CONFIG_ARCH_HAS_STRICT_KERNEL_RWX)
static inline void mark_readonly(void)
{
pr_warn("Kernel memory protection not selected by kernel config.\n");
}
#else
static inline void mark_readonly(void)
{
Expand Down

0 comments on commit f596ded

Please sign in to comment.