Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH 0/2] efi/zboot: Put ZSTD output size where it belongs
@ 2026-11-26 22:44 Ard Biesheuvel
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2026-11-26 22:44 UTC (permalink / raw)
  To: linux-efi; +Cc: Ard Biesheuvel, Nathan Chancellor, Nicolas Schier, linux-kbuild

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-26 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 22:44 [PATCH 0/2] efi/zboot: Put ZSTD output size where it belongs Ard Biesheuvel
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox