Re: [GIT PULL 0/1] EFI fix for v4.19-rc

2018-09-18 Thread Thomas Gleixner
On Tue, 18 Sep 2018, Ard Biesheuvel wrote:

> The following changes since commit 11da3a7f84f19c26da6f86af878298694ede0804:
> 
>   Linux 4.19-rc3 (2018-09-09 17:26:43 -0700)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git efi-urgent
> 
> for you to fetch changes up to d310959365942b100f79b56bcce859968fe7ca9c:
> 
>   efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to y (2018-09-12 16:41:41 
> +0200)
> 
> 
> Apply a fix from Scott to make the ARM stub's DTB loader opt-out rather
> than opt-in.

Pulled. Thanks Ard!

tglx


Re: [PATCH] x86: boot: Fix EFI stub alignment

2018-09-18 Thread Ard Biesheuvel
On 16 September 2018 at 08:22, Ben Hutchings  wrote:
> 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: Ben Hutchings 
> ---

Thanks, queued in efi/next.


> --- a/arch/x86/boot/tools/build.c
> +++ b/arch/x86/boot/tools/build.c
> @@ -391,6 +391,13 @@ int main(int argc, char ** argv)
> die("Unable to mmap '%s': %m", argv[2]);
> /* Number of 16-byte paragraphs, including space for a 4-byte CRC */
> sys_size = (sz + 15 + 4) / 16;
> +#ifdef CONFIG_EFI_STUB
> +   /*
> +* COFF requires minimum 32-byte alignment of sections, and
> +* adding a signature is problematic without that alignment.
> +*/
> +   sys_size = (sys_size + 1) & ~1;
> +#endif
>
> /* Patch the setup code with the appropriate size parameters */
> buf[0x1f1] = setup_sectors-1;


[PATCH 1/1] efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to y

2018-09-18 Thread Ard Biesheuvel
From: Scott Branden 

Default EFI_ARMSTUB_DTB_LOADER to y to allow the dtb= command
line parameter to function with efi loader.

Required for development purposes and to boot on existing bootloaders
that do not support devicetree provided by the firmware or by the
bootloader.

Fixes: 3d7ee348aa41 ("efi/libstub/arm: Add opt-in Kconfig option ...")
Signed-off-by: Scott Branden 
Signed-off-by: Ard Biesheuvel 
---
 drivers/firmware/efi/Kconfig | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig
index d8e159feb573..89110dfc7127 100644
--- a/drivers/firmware/efi/Kconfig
+++ b/drivers/firmware/efi/Kconfig
@@ -90,14 +90,17 @@ config EFI_ARMSTUB
 config EFI_ARMSTUB_DTB_LOADER
bool "Enable the DTB loader"
depends on EFI_ARMSTUB
+   default y
help
  Select this config option to add support for the dtb= command
  line parameter, allowing a device tree blob to be loaded into
  memory from the EFI System Partition by the stub.
 
- The device tree is typically provided by the platform or by
- the bootloader, so this option is mostly for development
- purposes only.
+ If the device tree is provided by the platform or by
+ the bootloader this option may not be needed.
+ But, for various development reasons and to maintain existing
+ functionality for bootloaders that do not have such support
+ this option is necessary.
 
 config EFI_BOOTLOADER_CONTROL
tristate "EFI Bootloader Control"
-- 
2.17.1



[GIT PULL 0/1] EFI fix for v4.19-rc

2018-09-18 Thread Ard Biesheuvel
The following changes since commit 11da3a7f84f19c26da6f86af878298694ede0804:

  Linux 4.19-rc3 (2018-09-09 17:26:43 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git efi-urgent

for you to fetch changes up to d310959365942b100f79b56bcce859968fe7ca9c:

  efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to y (2018-09-12 16:41:41 
+0200)


Apply a fix from Scott to make the ARM stub's DTB loader opt-out rather
than opt-in.


Scott Branden (1):
  efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to y

 drivers/firmware/efi/Kconfig | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)