Commit a7c99a58 authored by Kees Cook's avatar Kees Cook Committed by liwei
Browse files

x86, relocs: Ignore relocations in .notes section

stable inclusion
from stable-v4.19.311
commit 13edb509abc91c72152a11baaf0e7c060a312e03
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9FNFG
CVE: CVE-2024-26816

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=13edb509abc91c72152a11baaf0e7c060a312e03



--------------------------------

[ 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: default avatarGuixiong Wei <guixiongwei@gmail.com>
Closes: https://lore.kernel.org/all/20240218073501.54555-1-guixiongwei@gmail.com/


Fixes: 5ead97c8 ("xen: Core Xen implementation")
Fixes: da1a679c ("Add /sys/kernel/notes")
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarliwei <liwei728@huawei.com>
parent 4c131939
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment