Skip to content

efi/zboot: Put ZSTD output size where it belongs

Ard Biesheuvel linux-efi linux-kbuild 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2scripts/Makefile.lib: Capture decompressed size in ZSTD22 metadatascripts/Makefile.lib+7 -30 replies
2/2efi/zboot: Use ZSTD frame header for uncompressed payload sizedrivers/firmware/efi/libstub/Makefile.zboot drivers/firmware/efi/libstub/zboot-decompress-gzip.c drivers/firmware/efi/libstub/zboot-decompress-zstd.c +2 more+19 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] efi/zboot: Put ZSTD output size where it belongs

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 <[email protected]>
Cc Nicolas Schier <[email protected]>

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(-)
Signature · 1 line
2.47.3