linux-stable/arch
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
..
alpha RTC for 6.8 2024-01-18 17:25:39 -08:00
arc IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
arm fortify: Improve buffer overflow reporting 2024-02-29 13:38:02 -08:00
arm64 ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00
csky vfs-6.8.netfs 2024-01-19 09:10:23 -08:00
hexagon asm-generic cleanups for 6.8 2024-01-10 18:13:44 -08:00
loongarch LoongArch: KVM: Add returns to SIMD stubs 2024-01-26 16:22:07 +08:00
m68k percpu: 2024-01-18 15:01:28 -08:00
microblaze Microblaze patches for 6.8-rc1 2024-01-17 11:27:23 -08:00
mips ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00
nios2 percpu: 2024-01-18 15:01:28 -08:00
openrisc
parisc ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00
powerpc ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00
riscv ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00
s390 ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00
sh kernel.h: removed REPEAT_BYTE from kernel.h 2024-02-01 09:47:59 -08:00
sparc sparc: vdso: Disable UBSAN instrumentation 2024-02-29 13:38:03 -08:00
um um: Convert strscpy() usage to 2-argument style 2024-02-20 20:47:32 -08:00
x86 x86, relocs: Ignore relocations in .notes section 2024-02-29 22:34:42 -08:00
xtensa percpu: 2024-01-18 15:01:28 -08:00
.gitignore
Kconfig IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00