• Ben Hutchings's avatar
    x86: boot: Fix EFI stub alignment · fcc506ca
    Ben Hutchings authored
    [ Upstream commit 9c1442a9d039a1a3302fa93e9a11001c5f23b624 ]
    
    We currently align the end of the compressed image to a multiple of
    16.  However, the PE-COFF header included in the EFI stub says that
    the file alignment is 32 bytes, and when adding an EFI signature to
    the file it must first be padded to this alignment.
    
    sbsigntool commands warn about this:
    
      warning: file-aligned section .text extends beyond end of file
      warning: checksum areas are greater than image size. Invalid section table?
    
    Worse, pesign -at least when creating a detached signature- uses the
    hash of the unpadded file, resulting in an invalid signature if
    padding is required.
    
    Avoid both these problems by increasing alignment to 32 bytes when
    CONFIG_EFI_STUB is enabled.
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    fcc506ca
Name
Last commit
Last update
..
compressed Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
a20.c Loading commit data...
apm.c Loading commit data...
bioscall.S Loading commit data...
bitops.h Loading commit data...
boot.h Loading commit data...
cmdline.c Loading commit data...
code16gcc.h Loading commit data...
copy.S Loading commit data...
cpu.c Loading commit data...
cpucheck.c Loading commit data...
cpuflags.c Loading commit data...
cpuflags.h Loading commit data...
ctype.h Loading commit data...
early_serial_console.c Loading commit data...
edd.c Loading commit data...
header.S Loading commit data...
install.sh Loading commit data...
main.c Loading commit data...
memory.c Loading commit data...
mkcpustr.c Loading commit data...
mtools.conf.in Loading commit data...
pm.c Loading commit data...
pmjump.S Loading commit data...
printf.c Loading commit data...
regs.c Loading commit data...
setup.ld Loading commit data...
string.c Loading commit data...
string.h Loading commit data...
tty.c Loading commit data...
version.c Loading commit data...
vesa.h Loading commit data...
video-bios.c Loading commit data...
video-mode.c Loading commit data...
video-vesa.c Loading commit data...
video-vga.c Loading commit data...
video.c Loading commit data...
video.h Loading commit data...