diff options
| author | 2026-05-21 20:58:36 +0800 | |
|---|---|---|
| committer | 2026-05-21 20:58:36 +0800 | |
| commit | 03d8273542146f228c0019f08b57545fdee79704 (patch) | |
| tree | 27d660e418bcbe564e273e31f0c0c3bd0690840e /tools/docs/ssh:/git@git.zx2c4.com | |
| parent | Linux 7.1-rc4 (diff) | |
efi/loongarch: Randomize kernel preferred address for KASLR
Introduce efi_get_kimg_kaslr_address() helper to compute the preferred
kernel image load address dynamically when CONFIG_RANDOMIZE_BASE is
enabled. The function derives a random offset by using the EFI-provided
randomness combined with the timer tick value, and constrains it within
CONFIG_RANDOMIZE_BASE_MAX_OFFSET.
Update EFI_KIMG_PREFERRED_ADDRESS to call this helper so that the EFI
stub can select a randomized load address when KASLR is active, while
preserving the original base address behavior when KASLR is disabled or
"nokaslr" is specified.
Note: LoongArch can't KASLR for hibernation, so set efi_nokaslr to true
if "resume=<devname>" is explicitly specified in cmdline.
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'tools/docs/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
