linux-stable/arch/x86
Kees Cook a4e7ff1a74 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:21:51 -04:00
..
boot x86/boot: Ignore NMIs during very early boot 2024-02-23 08:42:02 +01:00
configs x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs 2022-01-27 10:54:21 +01:00
crypto crypto: x86/ghash - fix unaligned access in ghash_setkey() 2023-03-11 16:39:19 +01:00
entry x86/mm: Fix VDSO and VVAR placement on 5-level paging machines 2023-08-16 18:21:00 +02:00
events x86: Share definition of __is_canonical_address() 2023-11-20 11:06:56 +01:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2023-01-14 10:16:13 +01:00
ia32
include x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h 2024-03-26 18:21:46 -04:00
kernel x86/paravirt: Fix build due to __text_gen_insn() backport 2024-03-26 18:21:47 -04:00
kvm KVM: use __vcalloc for very large allocations 2024-02-23 08:41:55 +01:00
lib x86/lib: Fix overflow when counting digits 2024-01-25 14:37:39 -08:00
math-emu x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
mm x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 2024-03-26 18:21:46 -04:00
net x86/returnthunk: Allow different return thunks 2024-03-01 13:16:49 +01:00
oprofile
pci x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot 2023-04-20 12:10:27 +02:00
platform x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-21 15:16:14 +02:00
power x86/pm: Add enumeration check before spec MSRs save/restore setup 2022-12-08 11:23:59 +01:00
purgatory x86/purgatory: remove PGO flags 2023-06-21 15:45:37 +02:00
ras
realmode x86/mm: Flush global TLB when switching to trampoline page-table 2022-01-27 10:54:14 +01:00
tools x86, relocs: Ignore relocations in .notes section 2024-03-26 18:21:51 -04:00
um x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list 2023-03-11 16:40:11 +01:00
video
xen x86/xen: Add some null pointer checking to smp.c 2024-03-26 18:21:45 -04:00
.gitignore
Kbuild
Kconfig x86/srso: Add a Speculative RAS Overflow mitigation 2023-08-08 19:57:40 +02:00
Kconfig.assembler
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 08:42:28 +01:00
Kconfig.debug
Makefile x86/realmode: build with -D__DISABLE_EXPORTS 2022-07-25 11:26:33 +02:00
Makefile.um um: allow not setting extra rpaths in the linux binary 2024-03-15 10:48:18 -04:00
Makefile_32.cpu