[PATCH] kaslr: x86: fixes log message nokaslr

From: Mahmoud Younes
Date: Sun Mar 31 2024 - 16:06:03 EST


Unknown kernel command line parameters nokaslr message will be printed
to kernel log buffer if nokaslr option exists in boot command line.
nokaslr gets consumed earlier and this message becomes confusing.
impact is that user gets confused whether kaslr is enabled or not.

Signed-off-by: Mahmoud Younes <m.younesbadr@xxxxxxxxx>
---
arch/x86/mm/kaslr.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/x86/mm/kaslr.c b/arch/x86/mm/kaslr.c
index 37db264866b6..a62cb0675e22 100644
--- a/arch/x86/mm/kaslr.c
+++ b/arch/x86/mm/kaslr.c
@@ -179,3 +179,9 @@ void __meminit init_trampoline_kaslr(void)
__pgd(_KERNPG_TABLE | __pa(pud_page_tramp));
}
}
+
+static int __init parse_nokaslr(char *_)
+{
+ return 0;
+}
+early_param("nokaslr", parse_nokaslr);
--
2.34.1