mbox series

[GIT,PULL,00/17] EFI updates for v4.18

Message ID 20180504060003.19618-1-ard.biesheuvel@linaro.org
Headers show
Series EFI updates for v4.18 | expand

Message

Ard Biesheuvel May 4, 2018, 5:59 a.m. UTC
The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:

  Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-next

for you to fetch changes up to a0e781fedc0e975d2f33fda94e26d3f76331ee3d:

  efi/libstub/arm64: handle randomized TEXT_OFFSET (2018-05-03 19:00:27 +0200)

----------------------------------------------------------------
First batch of EFI changes for v4.18:
- Initialize UEFI secure boot state during Xen dom0 boot (Daniel Kiper)
- Decode x86 CPER data (Yazen Ghannam)
- Ignore unrealistically large option roms (Hans de Goede)
- Additional minor tweaks
- A fix for arm64 kernels with CONFIG_RANDOMIZE_TEXT_OFFSET=y and running
  with KASLR enabled. I was on the fence whether to send it as a fix or
  cc it to stable, so I chose the latter. (TEXT_OFFSET randomization is a
  debug feature that the distros don't enable)

----------------------------------------------------------------
Ard Biesheuvel (3):
      efi: fix efi_pci_io_protocol32 prototype for mixed mode
      efi: align efi_pci_io_protocol typedefs to type naming convention
      efi/x86: fold __setup_efi_pci32 and __setup_efi_pci64 into one

Borislav Petkov (1):
      efi/cper: Remove the INDENT_SP silliness

Daniel Kiper (1):
      x86/xen/efi: Initialize UEFI secure boot state during dom0 boot

Hans de Goede (1):
      efi/x86: Ignore unrealistically large option roms

Mark Rutland (1):
      efi/libstub/arm64: handle randomized TEXT_OFFSET

Shunyong Yang (1):
      efi/capsule-loader: Don't output reset log when reset flags are not set

Wei Yongjun (1):
      efi/libstub/tpm: Make function efi_retrieve_tpm2_eventlog_1_2() static

Yazen Ghannam (8):
      efi: Fix IA32/X64 Processor Error Record definition
      efi: Decode IA32/X64 Processor Error Section
      efi: Decode IA32/X64 Processor Error Info Structure
      efi: Decode UEFI-defined IA32/X64 Error Structure GUIDs
      efi: Decode IA32/X64 Cache, TLB, and Bus Check structures
      efi: Decode additional IA32/X64 Bus Check fields
      efi: Decode IA32/X64 MS Check structure
      efi: Decode IA32/X64 Context Info structure

 arch/x86/boot/compressed/eboot.c          | 112 +++-------
 arch/x86/xen/efi.c                        |  57 +++++
 drivers/firmware/efi/Kconfig              |   5 +
 drivers/firmware/efi/Makefile             |   1 +
 drivers/firmware/efi/capsule-loader.c     |  14 +-
 drivers/firmware/efi/cper-arm.c           |   6 +-
 drivers/firmware/efi/cper-x86.c           | 356 ++++++++++++++++++++++++++++++
 drivers/firmware/efi/cper.c               |  16 +-
 drivers/firmware/efi/libstub/arm64-stub.c |   7 +
 drivers/firmware/efi/libstub/secureboot.c |   3 +
 drivers/firmware/efi/libstub/tpm.c        |   2 +-
 include/linux/cper.h                      |   4 +-
 include/linux/efi.h                       |  14 +-
 13 files changed, 496 insertions(+), 101 deletions(-)
 create mode 100644 drivers/firmware/efi/cper-x86.c

Comments

Ingo Molnar May 14, 2018, 6:58 a.m. UTC | #1
* Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> On 14 May 2018 at 08:43, Ingo Molnar <mingo@kernel.org> wrote:

> >

> > So I looked at arch/x86/boot/compressed/eboot.c to improve a printk message and

> > ended up with the cleanups below.

> >

> > Only build tested.

> >

> > Thanks,

> >

> >         Ingo

> >

> > =================>

> > Subject: efi/x86: Clean up the eboot code

> > From: Ingo Molnar <mingo@kernel.org>

> > Date: Mon May 14 08:33:40 CEST 2018

> >

> > Various small cleanups:

> >

> >  - Standardize printk messages:

> >

> >      'alloc' => 'allocate'

> >      'mem'   => 'memory'

> >

> >    also put variable names in printk messages between quotes.

> >

> >  - Align mass-assignments vertically for better readability

> >

> >  - Break multi-line function prototypes at the name where possible,

> >    not in the middle of the parameter list

> >

> >  - Use a newline before return statements consistently.

> >

> >  - Use curly braces in a balanced fashion.

> >

> >  - Remove stray newlines.

> >

> > No change in functionality.

> >

> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> > Cc: Linus Torvalds <torvalds@linux-foundation.org>

> > Cc: Matt Fleming <matt@codeblueprint.co.uk>

> > Cc: Peter Zijlstra <peterz@infradead.org>

> > Cc: Thomas Gleixner <tglx@linutronix.de>

> > Cc: linux-efi@vger.kernel.org

> > Signed-off-by: Ingo Molnar <mingo@kernel.org>

> 

> Thanks Ingo

> 

> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


Thanks - mind picking it up into your tree? I only did minimal testing and don't 
want to interfere with your patch flow either.

Thanks,

	Ingo
Ard Biesheuvel May 14, 2018, 6:59 a.m. UTC | #2
On 14 May 2018 at 08:58, Ingo Molnar <mingo@kernel.org> wrote:
>

> * Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

>

>> On 14 May 2018 at 08:43, Ingo Molnar <mingo@kernel.org> wrote:

>> >

>> > So I looked at arch/x86/boot/compressed/eboot.c to improve a printk message and

>> > ended up with the cleanups below.

>> >

>> > Only build tested.

>> >

>> > Thanks,

>> >

>> >         Ingo

>> >

>> > =================>

>> > Subject: efi/x86: Clean up the eboot code

>> > From: Ingo Molnar <mingo@kernel.org>

>> > Date: Mon May 14 08:33:40 CEST 2018

>> >

>> > Various small cleanups:

>> >

>> >  - Standardize printk messages:

>> >

>> >      'alloc' => 'allocate'

>> >      'mem'   => 'memory'

>> >

>> >    also put variable names in printk messages between quotes.

>> >

>> >  - Align mass-assignments vertically for better readability

>> >

>> >  - Break multi-line function prototypes at the name where possible,

>> >    not in the middle of the parameter list

>> >

>> >  - Use a newline before return statements consistently.

>> >

>> >  - Use curly braces in a balanced fashion.

>> >

>> >  - Remove stray newlines.

>> >

>> > No change in functionality.

>> >

>> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>> > Cc: Linus Torvalds <torvalds@linux-foundation.org>

>> > Cc: Matt Fleming <matt@codeblueprint.co.uk>

>> > Cc: Peter Zijlstra <peterz@infradead.org>

>> > Cc: Thomas Gleixner <tglx@linutronix.de>

>> > Cc: linux-efi@vger.kernel.org

>> > Signed-off-by: Ingo Molnar <mingo@kernel.org>

>>

>> Thanks Ingo

>>

>> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>

> Thanks - mind picking it up into your tree? I only did minimal testing and don't

> want to interfere with your patch flow either.

>


Will do, thanks.
Ard Biesheuvel May 14, 2018, 7:02 a.m. UTC | #3
On 14 May 2018 at 08:57, Ingo Molnar <mingo@kernel.org> wrote:
>

> * Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

>

>> Mixed mode allows a kernel built for x86_64 to interact with 32-bit

>> EFI firmware, but requires us to define all struct definitions carefully

>> when it comes to pointer sizes. efi_pci_io_protocol32 currently uses a

>> void* for the 'romimage' field, which will be interpreted as a 64-bit

>> field on such kernels, potentially resulting in bogus memory references

>> and subsequent crashes.

>

> Yeah, so the first confusion I ran into is:

>

>  s/efi_pci_io_protocol32

>   /efi_pci_io_protocol_32

>

> Once I found it in the code I made this change:

>

>  s/efi: fix efi_pci_io_protocol32 prototype for mixed mode

>   /efi: Fix 'struct efi_pci_io_protocol32' definition for mixed mode

>

> Because we normally use the 'prototype' name for function declarations, not for

> data type definitions. Adding 'struct' and putting it between quotes makes it

> obvious at a glance that we are talking about a structure definition here.

>


OK.

> BTW., since it's marked -stable, due to:

>

>  > potentially resulting in bogus memory references

>  > and subsequent crashes.

>

> I'm moving it to efi/urgent: the principle here is that if a patch is urgent

> enough for -stable then it should generally not wait for the next merge window.

>


The issue was found by inspection rather than a crash report, so I was
in doubt about this.

> Also, because this actually fixes a crash, I extended the title to spell this out

> more clearly:

>

>   Subject: efi: Avoid potential crashes, fix the 'struct efi_pci_io_protocol_32' definition for mixed mode

>

> ... which also makes it easier for maintainers of older stable kernels to decide

> whether to backport the patch or not.

>


OK.

> Anyway, the patch is looking good otherwise, no need to resend.

>

> Thanks,

>

>         Ingo