linux-stable/arch/x86
Kees Cook 52018aa146 x86, relocs: Ignore relocations in .notes section
[ Upstream commit aaa8736370 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:22:16 -04:00
..
boot x86/decompressor: Don't rely on upper 32 bits of GPRs being preserved 2023-09-23 10:59:41 +02:00
configs
crypto crypto: x86/ghash - fix unaligned access in ghash_setkey() 2023-03-11 16:43:38 +01:00
entry x86/asm: Make more symbols local 2023-09-23 10:59:40 +02:00
events perf/x86/amd: fix potential integer overflow on shift of a int 2023-02-06 07:52:47 +01:00
hyperv x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails 2021-11-26 10:47:21 +01:00
ia32 binfmt: Move install_exec_creds after setup_new_exec to match binfmt_elf 2023-01-18 11:41:46 +01:00
include x86/entry/ia32: Ensure s32 is sign extended to s64 2024-02-23 08:24:53 +01:00
kernel x86/cpu/intel: Detect TME keyid bits before setting MTRR mask registers 2024-03-06 14:36:10 +00:00
kvm KVM: x86: Ignore MSR_AMD64_TW_CFG access 2023-11-28 16:50:18 +00:00
lib x86/lib: Fix overflow when counting digits 2024-01-25 14:34:21 -08:00
math-emu
mm x86/mm/ident_map: Use gbpages only where full GB page should be mapped. 2024-02-23 08:25:12 +01:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
oprofile
pci x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot 2023-04-20 12:07:32 +02:00
platform x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-25 11:18:10 +02:00
power x86/pm: Add enumeration check before spec MSRs save/restore setup 2022-12-08 11:23:05 +01:00
purgatory x86/purgatory: remove PGO flags 2023-06-28 10:18:35 +02:00
ras
realmode x86/asm: Make more symbols local 2023-09-23 10:59:40 +02:00
tools x86, relocs: Ignore relocations in .notes section 2024-03-26 18:22:16 -04:00
um x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list 2023-03-11 16:44:10 +01:00
video
xen x86/xen: Add some null pointer checking to smp.c 2024-03-26 18:22:12 -04:00
.gitignore
Kbuild
Kconfig x86/speculation: Add Kconfig option for GDS 2023-08-08 19:56:35 +02:00
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 08:25:12 +01:00
Kconfig.debug
Makefile x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) 2021-05-11 14:04:06 +02:00
Makefile.um um: allow not setting extra rpaths in the linux binary 2024-03-15 10:48:16 -04:00
Makefile_32.cpu