[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <62477e446d9685459d4f27d193af6ff1bd69d55f.1578557581.git.christophe.leroy@c-s.fr>
Date: Thu, 9 Jan 2020 08:15:01 +0000 (UTC)
From: Christophe Leroy <christophe.leroy@....fr>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-mm@...ck.org
Subject: [PATCH] init: fix misleading "This architecture does not have kernel
memory protection" message
This message leads to think 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."
Signed-off-by: Christophe Leroy <christophe.leroy@....fr>
---
init/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/init/main.c b/init/main.c
index 2cd736059416..fd31b15cc910 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1090,6 +1090,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)
{
--
2.13.3
Powered by blists - more mailing lists