linux/arch/x86/tools
Ard Biesheuvel 223abe96ac x86/xen: Avoid relocatable quantities in Xen ELF notes
Xen puts virtual and physical addresses into ELF notes that are treated
by the linker as relocatable by default. Doing so is not only pointless,
given that the ELF notes are only intended for consumption by Xen before
the kernel boots. It is also a KASLR leak, given that the kernel's ELF
notes are exposed via the world readable /sys/kernel/notes.

So emit these constants in a way that prevents the linker from marking
them as relocatable. This involves place-relative relocations (which
subtract their own virtual address from the symbol value) and linker
provided absolute symbols that add the address of the place to the
desired value.

Tested-by: Jason Andryuk <jason.andryuk@amd.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Message-ID: <20241009160438.3884381-11-ardb+git@google.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
2024-10-29 17:23:36 +01:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
gen-insn-attr-x86.awk x86/insn: Add support for APX EVEX to the instruction decoder logic 2024-05-02 13:13:45 +02:00
insn_decoder_test.c x86/tools/insn_decoder_test: Convert to insn_decode() 2021-03-15 12:09:09 +01:00
insn_sanity.c x86/tools/insn_sanity: Convert to insn_decode() 2021-03-15 12:21:11 +01:00
Makefile x86/tools: Remove chkobjdump.awk 2023-11-30 09:38:12 +01:00
objdump_reformat.awk x86/tools: objdump_reformat.awk: Skip bad instructions from llvm-objdump 2024-01-04 10:04:02 +01:00
relocs_32.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
relocs_64.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
relocs_common.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
relocs.c x86/xen: Avoid relocatable quantities in Xen ELF notes 2024-10-29 17:23:36 +01:00
relocs.h x86/tools/relocs: Mark die() with the printf function attr format 2021-08-23 05:58:02 +02:00