[PATCH] UKI: Fix the size of real payload

Simon Horman horms at kernel.org
Fri Dec 12 02:13:19 PST 2025


On Fri, Dec 05, 2025 at 10:05:36AM +0800, Pingfan Liu wrote:
> According to the PE file specification, each section's SizeOfRawData
> must be a multiple of FileAlignment (usually 512). So when ukify builds
> a UKI image, it pads the kernel image, initrd, etc. with zeros aligned
> to 512 bytes. The actual payload size is recorded in VirtualSize.
> 
> Since the checksum includes the trailing zeros, this causes issues when
> loading a signed x86 bzImage, which is stored in the UKI's .linux
> section.
> 
> Credit goes to Philipp, who analysed and pointed out this issue to me.
> 
> Signed-off-by: Pingfan Liu <piliu at redhat.com>
> Cc: Philipp Rudo <prudo at redhat.com>
> To: Simon Horman <horms at kernel.org>
> To: kexec at lists.infradead.org

Thanks, applied.

- UKI: Fix the size of real payload
  https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=e18a71faae08



More information about the kexec mailing list