public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel•org>
To: Catalin Marinas <catalin.marinas@arm•com>, Will Deacon <will@kernel•org>
Cc: Mark Brown <broonie@kernel•org>, linux-arm-kernel@lists•infradead.org
Subject: [PATCH] arm64: kaslr: Print warning if KASLR is disabled due to lack of seed
Date: Thu,  7 Nov 2019 12:12:41 +0000	[thread overview]
Message-ID: <20191107121241.8458-1-broonie@kernel.org> (raw)

It seems to be a relatively common system integration error for system
integrators and administrators to enable KASLR in their configuration but
not provide the seed at runtime, sometimes due to that breaking at some
later point after it is initially enabled. Since KASLR is not announced at
boot time unless it forces on KPTI this can lead to users incorrectly
believing their system has the feature enabled when in fact it does not,
and if they notice the problem the lack of any diagnostics makes it harder
to understand the problem. Provide a warning message to assist in these
situations.

Signed-off-by: Mark Brown <broonie@kernel•org>
---
 arch/arm64/kernel/kaslr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c
index 416f537bf614..c2ba5e783ada 100644
--- a/arch/arm64/kernel/kaslr.c
+++ b/arch/arm64/kernel/kaslr.c
@@ -98,8 +98,10 @@ u64 __init kaslr_early_init(u64 dt_phys)
 	 * Retrieve (and wipe) the seed from the FDT
 	 */
 	seed = get_kaslr_seed(fdt);
-	if (!seed)
+	if (!seed) {
+		pr_warn("No seed available for KASLR, disabling\n");
 		return 0;
+	}
 
 	/*
 	 * Check if 'nokaslr' appears on the command line, and
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-11-07 12:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07 12:12 Mark Brown [this message]
2019-11-08 13:38 ` [PATCH] arm64: kaslr: Print warning if KASLR is disabled due to lack of seed Catalin Marinas
2019-11-08 14:14   ` Mark Rutland
2019-11-08 14:35     ` Mark Brown
2019-11-08 14:17   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191107121241.8458-1-broonie@kernel.org \
    --to=broonie@kernel$(echo .)org \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=will@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox