diff options
author | WANG Chao <chaowang@redhat.com> | 2014-03-28 15:05:00 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2014-03-28 09:44:56 -0700 |
commit | 0d526445f3d3f26f50e674d75ceee344c31369f1 (patch) | |
tree | 9042553a76b9aab1da0fd3014b081bf7a22d1f18 /kexec/arch/arm/kexec-zImage-arm.c | |
parent | 3e5443fffb2c311a61fe157be25b80de53329604 (diff) |
x86, kaslr: add alternative way to locate kernel text mapping area
When kASLR is enabled (CONFIG_RANDOMIZED_BASE=y), kernel text mapping
base is randomized. The max base offset of such randomization is
configured at compile time through CONFIG_RANDOMIZE_MAX_BASE_OFFSET (by
default 1G).
Currently kexec-tools is using hard code macro X86_64__START_KERNEL_map
(0xffffffff80000000) and X86_64_KERNEL_TEXT_SIZE (512M) to determine
kernel text mapping from kcore's PT_LOAD. With kASLR, the mapping is
changed as the following:
ffffffff80000000 - (ffffffff80000000+CONFIG_RANDOMIZE_BASE_MAX_OFFSET)
As Vivek suggested, we can get _stext kernel symbol address from
/proc/kallsyms, and search for kcore's PT_LOAD which contains _stext,
and we can say that this area represents the kernel mapping area.
Let's first use this way to find out kernel text mapping. If failed for
whatever reason, fall back to use the old way.
Suggested-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/arm/kexec-zImage-arm.c')
0 files changed, 0 insertions, 0 deletions