From d7edc8d0a0319dcc36f89b30cbe3213f31c1f664 Mon Sep 17 00:00:00 2001 From: Juxin Gao Date: Mon, 15 Dec 2025 16:36:09 +0800 Subject: [PATCH] Loongarch: Enable CONFIG_RANDOMIZE_BASE default Loongarch inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDD36Q ---------------------------------------------- The `nokaslr` kernel command-line parameter is incorrectly passed through to the user-space init process when the kernel is compiled without CONFIG_RANDOMIZE_BASE configuration. The root cause is that the `early_param()` mechanism for "nokaslr" is only effective when KASLR support is enabled (CONFIG_RANDOMIZE_BASE=y). When this option is disabled, the parameter is not consumed by the early boot parsing code and remains on the command line. Consequently, it gets passed to the init process as an unrecognized argument, which may cause confusion or errors. This patch ensures that the "nokaslr" parameter is properly marked as handled even when CONFIG_RANDOMIZE_BASE is not set, preventing it from being propagated to user space. Fixes: db9925f1fdda ("LoongArch: fix KASLR can not be disabled by nokaslr when boot from old BPI") Signed-off-by: Juxin Gao --- arch/loongarch/configs/loongson3_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig index 18ae1bdbce2a..e80966cb4f39 100644 --- a/arch/loongarch/configs/loongson3_defconfig +++ b/arch/loongarch/configs/loongson3_defconfig @@ -47,6 +47,8 @@ CONFIG_ARCH_IOREMAP=y CONFIG_CPU_HAS_LSX=y CONFIG_CPU_HAS_LASX=y CONFIG_CPU_HAS_LBT=y +CONFIG_RANDOMIZE_BASE=y +CONFIG_RANDOMIZE_BASE_MAX_OFFSET=0x01000000 CONFIG_LIVEPATCH=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_STAT=y -- Gitee