linux-yocto/arch/loongarch
Youling Tang 987f2bd63a LoongArch: Automatically disable kaslr if boot from kexec_file
commit c8168b4faf1d62cbb320a3e518ad31cdd567cb05 upstream.

Automatically disable kaslr when the kernel loads from kexec_file.

kexec_file loads the secondary kernel image to a non-linked address,
inherently providing KASLR-like randomization.

However, on LoongArch where System RAM may be non-contiguous, enabling
KASLR for the second kernel may relocate it to an invalid memory region
and cause a boot failure. Thus, we disable KASLR when "kexec_file" is
detected in the command line.

To ensure compatibility with older kernels loaded via kexec_file, this
patch should be backported to stable branches.

Cc: stable@vger.kernel.org
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-15 12:00:22 +02:00
..
boot LoongArch: Fix GMAC's phy-mode definitions in dts 2024-06-03 15:45:53 +08:00
configs mm: z3fold: deprecate CONFIG_Z3FOLD 2024-09-17 01:07:00 -07:00
crypto move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
include LoongArch: Align ACPI structures if ARCH_STRICT_ALIGN enabled 2025-09-25 11:13:46 +02:00
kernel LoongArch: Automatically disable kaslr if boot from kexec_file 2025-10-15 12:00:22 +02:00
kvm LoongArch: KVM: Make function kvm_own_lbt() robust 2025-08-28 16:31:02 +02:00
lib LoongArch: csum: Fix OoB access in IP checksum code for negative lengths 2025-02-21 14:01:17 +01:00
mm LoongArch: Fix panic caused by NULL-PMD in huge_pte_offset() 2025-06-27 11:11:37 +01:00
net LoongArch: BPF: Fix jump offset calculation in tailcall 2025-08-20 18:30:14 +02:00
pci LoongArch: Fix memleak in pci_acpi_scan_root() 2024-09-24 15:32:20 +08:00
power LoongArch: Save and restore CSR.CNTC for hibernation 2025-05-22 14:29:44 +02:00
vdso LoongArch: vDSO: Remove -nostdlib complier flag 2025-09-09 18:58:05 +02:00
Kbuild LoongArch: Allow device trees be built into the kernel 2024-01-17 12:43:00 +08:00
Kconfig LoongArch: Update help info of ARCH_STRICT_ALIGN 2025-09-25 11:13:45 +02:00
Kconfig.debug LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub 2024-06-21 10:18:40 +08:00
Makefile LoongArch: Explicitly specify code model in Makefile 2024-12-05 14:02:45 +01:00