Commit f4f59ca6 authored by Cui GaoSheng's avatar Cui GaoSheng Committed by Zheng Zengkai
Browse files

efi/libstub: arm64: Fix KASLR and memmap= collision

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5J0X7


CVE: NA

--------------------------------

CONFIG_RANDOMIZE_BASE=y relocates the kernel to a random base address.

However, on arm64, it does not take into account the memmap= parameter
passed in from the kernel command line. This results in the kernel
sometimes being put in the middle of memmap.

Add support for memmap kernel parameters parsing on ARM64. The below
modes are only supported:

memmap=nn[KMG]$ss[KMG]

Region of memory to be reserved is from ss to ss+nn, the region must
be in the range of existed memory, otherwise will be ignored.

Teach KASLR to not insert the kernel in memmap defined regions. We
support up to 32 memmap regions: any additional regions will cause
KASLR to disable.

Signed-off-by: default avatarCui GaoSheng <cuigaosheng1@huawei.com>
Reviewed-by: default avatarWang Weiyang <wangweiyang2@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 5a9f480a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment