mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
1642285e51
Symbol offsets to the KASLR base do not match symbol address in
the vmlinux image. That is the result of setting the KASLR base
to the beginning of .text section as result of an optimization.
Revert that optimization and allocate virtual memory for the
whole kernel image including __START_KERNEL bytes as per the
linker script. That allows keeping the semantics of the KASLR
base offset in sync with other architectures.
Rename __START_KERNEL to TEXT_OFFSET, since it represents the
offset of the .text section within the kernel image, rather than
a virtual address.
Still skip mapping TEXT_OFFSET bytes to save memory on pgtables
and provoke exceptions in case an attempt to access this area is
made, as no kernel symbol may reside there.
In case CONFIG_KASAN is enabled the location counter might exceed
the value of TEXT_OFFSET, while the decompressor linker script
forcefully resets it to TEXT_OFFSET, which leads to a sections
overlap link failure. Use MAX() expression to avoid that.
Reported-by: Omar Sandoval <osandov@osandov.com>
Closes: https://lore.kernel.org/linux-s390/ZnS8dycxhtXBZVky@telecaster.dhcp.thefacebook.com/
Fixes:
|
||
---|---|---|
.. | ||
.gitignore | ||
als.c | ||
alternative.c | ||
boot.h | ||
clz_ctz.c | ||
cmdline.c | ||
ctype.c | ||
decompressor.c | ||
decompressor.h | ||
ebcdic.c | ||
head_kdump.S | ||
head.S | ||
install.sh | ||
ipl_data.c | ||
ipl_parm.c | ||
ipl_report.c | ||
ipl_vmparm.c | ||
kaslr.c | ||
kmsan.c | ||
machine_kexec_reloc.c | ||
Makefile | ||
mem.S | ||
pgm_check_info.c | ||
physmem_info.c | ||
sclp_early_core.c | ||
startup.c | ||
string.c | ||
uv.c | ||
uv.h | ||
version.c | ||
vmem.c | ||
vmlinux.lds.S |