From: Ard Biesheuvel <ardb@kernel.org>
To: linux-efi@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>,
linux-kbuild@vger.kernel.org
Subject: [PATCH 0/2] efi/zboot: Put ZSTD output size where it belongs
Date: Thu, 26 Nov 2026 23:44:01 +0100 [thread overview]
Message-ID: <20261126224400.10147-4-ardb@kernel.org> (raw)
The intent of the EFI zboot format is that non-EFI loaders can access
and decompress the payload using standard libraries and tools. However,
the ZSTD decompressed payload size is not stored in the header where the
standard library would look for it, but appended to the end similar to
how GZIP stores it.
Let's fix this, by capturing and storing the input size explicitly.
This is a prerequisite for upcoming ELF support in EFI zboot, which
concatenates several payloads, and therefore does not support appending
arbitrary data at the end.
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nsc@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Ard Biesheuvel (2):
scripts/Makefile.lib: Capture decompressed size in ZSTD22 metadata
efi/zboot: Use ZSTD frame header for uncompressed payload size
drivers/firmware/efi/libstub/Makefile.zboot | 8 +-------
drivers/firmware/efi/libstub/zboot-decompress-gzip.c | 5 +++--
drivers/firmware/efi/libstub/zboot-decompress-zstd.c | 17 ++++++++++++++---
drivers/firmware/efi/libstub/zboot-header.S | 2 +-
drivers/firmware/efi/libstub/zboot.lds | 1 -
scripts/Makefile.lib | 10 +++++++---
6 files changed, 26 insertions(+), 17 deletions(-)
--
2.47.3
next reply other threads:[~2026-11-26 22:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 22:44 Ard Biesheuvel [this message]
2026-11-26 22:44 ` [PATCH 1/2] scripts/Makefile.lib: Capture decompressed size in ZSTD22 metadata Ard Biesheuvel
2026-11-26 22:44 ` [PATCH 2/2] efi/zboot: Use ZSTD frame header for uncompressed payload size 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=20261126224400.10147-4-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.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