From: Ard Biesheuvel <ardb@kernel.org>
To: linux-efi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
Evgeniy Baskov <baskov@ispras.ru>, Borislav Petkov <bp@alien8.de>,
Andy Lutomirski <luto@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Alexey Khoroshilov <khoroshilov@ispras.ru>,
Peter Jones <pjones@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>, Dave Young <dyoung@redhat.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Kees Cook <keescook@chromium.org>,
Tom Lendacky <thomas.lendacky@amd.com>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: [RFC PATCH 0/3] efi: Implement generic zboot support
Date: Sun, 16 Apr 2023 14:07:26 +0200 [thread overview]
Message-ID: <20230416120729.2470762-1-ardb@kernel.org> (raw)
This series is a proof-of-concept that implements support for the EFI
zboot decompressor for x86. It replaces the ordinary decompressor, and
instead, performs the decompression, KASLR randomization and the 4/5
level paging switch while running in the execution context of EFI.
This simplifies things substantially, and makes it straight-forward to
abide by stricter future requirements related to the use of writable and
executable memory under EFI, which will come into effect on x86 systems
that are certified as being 'more secure', and ship with an even shinier
Windows sticker.
This is an alternative approach to the work being proposed by Evgeny [0]
that makes rather radical changes to the existing decompressor, which
has accumulated too many features already, e.g., related to confidential
compute etc.
EFI zboot images can be booted in two ways:
- by EFI firmware, which loads and starts it as an ordinary EFI
application, just like the existing EFI stub (with which it shares
most of its code);
- by a non-EFI loader that parses the image header for the compression
metadata, and decompresses the image into memory and boots it.
Realistically, the second option is unlikely to ever be used on x86,
given that it already has its existing bzImage, but the first option is
a good choice for distros that target EFI boot only (and some distros
switched to this format already for arm64). The fact that EFI zboot is
implemented in the same way on arm64, RISC-V, LoongArch and [shortly]
ARM helps with maintenance, not only of the kernel itself, but also the
tooling around it relating to kexec, code signing, deployment, etc.
Series can be pulled from [1], which contains some prerequisite patches
that are only tangentially related.
[0] https://lore.kernel.org/all/cover.1678785672.git.baskov@ispras.ru/
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-x86-zboot
Cc: Evgeniy Baskov <baskov@ispras.ru>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Peter Jones <pjones@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Ard Biesheuvel (3):
efi/libstub: x86: Split off pieces shared with zboot
efi/zboot: x86: Implement EFI zboot support
efi/zboot: x86: Clear NX restrictions on populated code regions
arch/x86/Makefile | 18 +-
arch/x86/include/asm/efi.h | 10 +
arch/x86/kernel/head_64.S | 15 +
arch/x86/zboot/Makefile | 29 +
drivers/firmware/efi/Kconfig | 2 +-
drivers/firmware/efi/libstub/Makefile | 15 +-
drivers/firmware/efi/libstub/Makefile.zboot | 2 +-
drivers/firmware/efi/libstub/efi-stub-helper.c | 3 +
drivers/firmware/efi/libstub/x86-stub.c | 592 +------------------
drivers/firmware/efi/libstub/x86-zboot.c | 322 ++++++++++
drivers/firmware/efi/libstub/x86.c | 612 ++++++++++++++++++++
drivers/firmware/efi/libstub/zboot.c | 3 +-
drivers/firmware/efi/libstub/zboot.lds | 5 +
13 files changed, 1031 insertions(+), 597 deletions(-)
create mode 100644 arch/x86/zboot/Makefile
create mode 100644 drivers/firmware/efi/libstub/x86-zboot.c
create mode 100644 drivers/firmware/efi/libstub/x86.c
--
2.39.2
next reply other threads:[~2023-04-16 12:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-16 12:07 Ard Biesheuvel [this message]
2023-04-16 12:07 ` [RFC PATCH 1/3] efi/libstub: x86: Split off pieces shared with zboot Ard Biesheuvel
2023-04-16 12:07 ` [RFC PATCH 2/3] efi/zboot: x86: Implement EFI zboot support Ard Biesheuvel
2023-04-16 12:07 ` [RFC PATCH 3/3] efi/zboot: x86: Clear NX restrictions on populated code regions Ard Biesheuvel
2023-04-18 14:10 ` [RFC PATCH 0/3] efi: Implement generic zboot support Evgeniy Baskov
2023-04-19 2:56 ` Dave Young
2023-04-19 5:54 ` Gerd Hoffmann
2023-04-19 14:44 ` Ard Biesheuvel
2023-04-20 6:07 ` Gerd Hoffmann
2023-04-20 7:54 ` Ard Biesheuvel
2023-04-20 12:29 ` Mario Limonciello
2023-04-21 13:29 ` Andy Lutomirski
2023-04-21 13:41 ` Ard Biesheuvel
2023-05-03 17:55 ` Andy Lutomirski
2023-05-03 18:13 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230416120729.2470762-1-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=baskov@ispras.ru \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dyoung@redhat.com \
--cc=keescook@chromium.org \
--cc=khoroshilov@ispras.ru \
--cc=kirill.shutemov@linux.intel.com \
--cc=kraxel@redhat.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pjones@redhat.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®