WSL2-Linux-Kernel/arch
Kees Cook c7cff97802 x86, relocs: Ignore relocations in .notes section
[ Upstream commit aaa8736370db1a78f0e8434344a484f9fd20be3b ]

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:21 -04:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:22:03 +02:00
arc ARC: fix spare error 2024-01-25 14:52:30 -08:00
arm ARM: dts: imx6dl-yapp4: Move the internal switch PHYs under the switch node 2024-03-26 18:21:20 -04:00
arm64 arm64: dts: marvell: reorder crypto interrupts on Armada SoCs 2024-03-26 18:21:20 -04:00
csky arch: consolidate arch_irq_work_raise prototypes 2024-02-23 08:54:39 +01:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-01 08:27:21 +01:00
hexagon hexagon: Fix function name in die() 2023-02-01 08:27:20 +01:00
ia64 memblock: allow to specify flags with memblock_add_node() 2023-12-20 15:17:33 +01:00
m68k memblock: allow to specify flags with memblock_add_node() 2023-12-20 15:17:33 +01:00
microblaze exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-03-26 18:21:12 -04:00
nds32 exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:59:14 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-11 23:00:37 +09:00
parisc parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check 2024-03-26 18:21:13 -04:00
powerpc powerpc/eeh: Set channel state after notifying the drivers 2024-03-01 13:21:53 +01:00
riscv riscv: dts: sifive: add missing #interrupt-cells to pmic 2024-03-26 18:21:12 -04:00
s390 s390/vdso: drop '-fPIC' from LDFLAGS 2024-03-26 18:21:18 -04:00
sh sh: bios: Revive earlyprintk support 2023-11-20 11:08:23 +01:00
sparc sparc32: fix a braino in fault handling in csum_and_copy_..._user() 2023-11-08 17:26:42 +01:00
um um: time-travel: fix time corruption 2024-02-23 08:54:50 +01:00
x86 x86, relocs: Ignore relocations in .notes section 2024-03-26 18:21:21 -04:00
xtensa xtensa: boot/lib: fix function prototypes 2023-10-06 13:18:14 +02:00
.gitignore
Kconfig scs: add CONFIG_MMU dependency for vfree_atomic() 2024-02-23 08:55:02 +01:00