1
linux/arch/x86/tools
Kees Cook aaa8736370 x86, relocs: Ignore relocations in .notes section
When building with CONFIG_XEN_PV=y, .text symbols are emitted into
the .notes section so that Xen can find the "startup_xen" entry point.
This information is used prior to booting the kernel, so relocations
are not useful. In fact, performing relocations against the .notes
section means that the KASLR base is exposed since /sys/kernel/notes
is world-readable.

To avoid leaking the KASLR base without breaking unprivileged tools that
are expecting to read /sys/kernel/notes, skip performing relocations in
the .notes section. The values readable in .notes are then identical to
those found in System.map.

Reported-by: Guixiong Wei <guixiongwei@gmail.com>
Closes: https://lore.kernel.org/all/20240218073501.54555-1-guixiongwei@gmail.com/
Fixes: 5ead97c84f ("xen: Core Xen implementation")
Fixes: da1a679cde ("Add /sys/kernel/notes")
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
2024-02-29 22:34:42 -08:00
..
.gitignore
gen-insn-attr-x86.awk x86/insn: Make inat-tables.c suitable for pre-decompression code 2020-09-07 19:45:24 +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
relocs_64.c
relocs_common.c
relocs.c x86, relocs: Ignore relocations in .notes section 2024-02-29 22:34:42 -08:00
relocs.h x86/tools/relocs: Mark die() with the printf function attr format 2021-08-23 05:58:02 +02:00