[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250811101955.GOaJnDy0-uy0quuouD@fat_crate.local>
Date: Mon, 11 Aug 2025 12:19:55 +0200
From: Borislav Petkov <bp@...en8.de>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org, x86@...nel.org,
Ard Biesheuvel <ardb@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Kevin Loughlin <kevinloughlin@...gle.com>,
Tom Lendacky <thomas.lendacky@....com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Nikunj A Dadhania <nikunj@....com>
Subject: Re: [PATCH v6 19/22] x86/boot: Create a confined code area for
startup code
On Tue, Jul 22, 2025 at 09:27:28AM +0200, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@...nel.org>
>
> In order to be able to have tight control over which code may execute
> from the early 1:1 mapping of memory, but still link vmlinux as a single
> executable, prefix all symbol references in startup code with __pi_, and
> invoke it from outside using the __pi_ prefix.
>
> Use objtool to check that no absolute symbol references are present in
> the startup code, as these cannot be used from code running from the 1:1
> mapping.
>
> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> ---
> arch/x86/boot/startup/Makefile | 14 ++++++++++++++
> arch/x86/boot/startup/sev-shared.c | 4 +---
> arch/x86/boot/startup/sme.c | 1 -
> arch/x86/coco/sev/core.c | 2 +-
> arch/x86/include/asm/setup.h | 1 +
> arch/x86/include/asm/sev.h | 1 +
> arch/x86/kernel/head64.c | 2 +-
> arch/x86/kernel/head_64.S | 8 ++++----
> arch/x86/mm/mem_encrypt_boot.S | 6 +++---
> tools/objtool/check.c | 3 ++-
> 10 files changed, 28 insertions(+), 14 deletions(-)
>
> diff --git a/arch/x86/boot/startup/Makefile b/arch/x86/boot/startup/Makefile
> index 32737f4ab5a8..e8fdf020b422 100644
> --- a/arch/x86/boot/startup/Makefile
> +++ b/arch/x86/boot/startup/Makefile
> @@ -4,6 +4,7 @@ KBUILD_AFLAGS += -D__DISABLE_EXPORTS
> KBUILD_CFLAGS += -D__DISABLE_EXPORTS -mcmodel=small -fPIC \
> -Os -DDISABLE_BRANCH_PROFILING \
> $(DISABLE_STACKLEAK_PLUGIN) \
> + $(DISABLE_LATENT_ENTROPY_PLUGIN) \
> -fno-stack-protector -D__NO_FORTIFY \
> -fno-jump-tables \
> -include $(srctree)/include/linux/hidden.h
Commit message should say something about that hunk I guess. It looks like it
disables the instrumentation that this plugin adds but I dunno.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists