[PATCH] efi: Fix the size not consistent issue when unmapping memory map

2018-05-01 Thread Lee, Chun-Yi
When using kdump, SOMETIMES the "size not consistent" warning message shows up when the crash kernel boots with early_ioremap_debug parameter: WARNING: CPU: 0 PID: 0 at ../mm/early_ioremap.c:182 early_iounmap+0x4f/0x12c() early_iounmap(ff200180, 0118) [0] size not consistent 0120

Re: [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set

2018-05-01 Thread Yang, Shunyong
Hi, Ard, On Tue, 2018-05-01 at 11:54 +0200, Ard Biesheuvel wrote: > On 25 April 2018 at 05:10, Shunyong Yang com> wrote: > > > > It means firmware attempts to immediately process or launch the > > capsule > > when flags in capsule header is not set. Moreover, reset is not > > needed > > in this

Re: [PATCH v5 2/5] efi: Add embedded peripheral firmware support

2018-05-01 Thread Lukas Wunner
On Tue, May 01, 2018 at 07:29:19PM +, Andy Lutomirski wrote: > On Sun, Apr 29, 2018 at 2:36 AM Hans de Goede wrote: > > + for (i = 0; i < size; i += 8) { > > + if (*((u64 *)(mem + i)) != *((u64 *)desc->prefix)) > > + continue; > > + > > +

Re: [PATCH v5 2/5] efi: Add embedded peripheral firmware support

2018-05-01 Thread Andy Lutomirski
On Sun, Apr 29, 2018 at 2:36 AM Hans de Goede wrote: > +The EFI embedded-fw code works by scanning all EFI_BOOT_SERVICES_CODE memory > +segments for an eight byte sequence matching prefix, if the prefix is found it > +then does a crc32 over length bytes and if that matches makes a copy of length >

Re: [PATCH v5 2/5] efi: Add embedded peripheral firmware support

2018-05-01 Thread Mimi Zohar
On Tue, 2018-05-01 at 21:11 +0200, Hans de Goede wrote: > Hi, > > On 01-05-18 16:36, Mimi Zohar wrote: > > [Cc'ing linux-security] > > > > On Sun, 2018-04-29 at 11:35 +0200, Hans de Goede wrote: > > [...] > >> diff --git a/drivers/base/firmware_loader/fallback_efi.c > >> b/drivers/base/firmware_

Re: [PATCH v5 2/5] efi: Add embedded peripheral firmware support

2018-05-01 Thread Hans de Goede
Hi, On 01-05-18 16:36, Mimi Zohar wrote: [Cc'ing linux-security] On Sun, 2018-04-29 at 11:35 +0200, Hans de Goede wrote: [...] diff --git a/drivers/base/firmware_loader/fallback_efi.c b/drivers/base/firmware_loader/fallback_efi.c new file mode 100644 index ..82ba82f48a79 --- /dev/

Re: [PATCH v5 2/5] efi: Add embedded peripheral firmware support

2018-05-01 Thread Mimi Zohar
[Cc'ing linux-security] On Sun, 2018-04-29 at 11:35 +0200, Hans de Goede wrote: [...] > diff --git a/drivers/base/firmware_loader/fallback_efi.c > b/drivers/base/firmware_loader/fallback_efi.c > new file mode 100644 > index ..82ba82f48a79 > --- /dev/null > +++ b/drivers/base/firmware_

RE: [PATCH v2] efi: Ignore unrealistically large option roms

2018-05-01 Thread David Laight
From: Ard Biesheuvel > Sent: 28 April 2018 07:41 > On 27 April 2018 at 23:35, Hans de Goede wrote: > > setup_efi_pci() tries to save a copy of each PCI option ROM as this may > > be necessary for the device driver for the PCI device to have access too. > > > > On some systems the efi_pci_io_protoc

Re: [PATCH v2] efi: Ignore unrealistically large option roms

2018-05-01 Thread Ard Biesheuvel
On 1 May 2018 at 15:52, David Laight wrote: > From: Ard Biesheuvel >> Sent: 28 April 2018 07:41 >> On 27 April 2018 at 23:35, Hans de Goede wrote: >> > setup_efi_pci() tries to save a copy of each PCI option ROM as this may >> > be necessary for the device driver for the PCI device to have access

Re: [PATCH -next] efi/libstub/tpm: Make function efi_retrieve_tpm2_eventlog_1_2() static

2018-05-01 Thread Jarkko Sakkinen
On Tue, Apr 24, 2018 at 08:39:09AM +0200, Ard Biesheuvel wrote: > On 23 April 2018 at 21:38, Jarkko Sakkinen > wrote: > > On Mon, Apr 16, 2018 at 01:05:24PM +0200, Ard Biesheuvel wrote: > >> On 22 March 2018 at 15:09, Jarkko Sakkinen > >> wrote: > >> > On Thu, 2018-03-22 at 16:06 +0200, Jarkko Sa

Re: [PATCH v4 0/4] Ignore unrealistically large option roms in EFI stub code

2018-05-01 Thread Ard Biesheuvel
On 1 May 2018 at 11:48, Hans de Goede wrote: > Hi, > > On 29-04-18 13:06, Ard Biesheuvel wrote: >> >> This is a continuation of Hans's work [0] to ignore bogus romimage/romsize >> values in the EFI PCI I/O protocol instances exposed by some UEFI >> firmwares >> on x86. >> >> I have only build test

Re: [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set

2018-05-01 Thread Ard Biesheuvel
On 25 April 2018 at 05:10, Shunyong Yang wrote: > It means firmware attempts to immediately process or launch the capsule > when flags in capsule header is not set. Moreover, reset is not needed > in this case. Current code will output log to indicate reset. > > This patch adds a branch to avoid r

Re: [PATCH v4 0/4] Ignore unrealistically large option roms in EFI stub code

2018-05-01 Thread Hans de Goede
Hi, On 29-04-18 13:06, Ard Biesheuvel wrote: This is a continuation of Hans's work [0] to ignore bogus romimage/romsize values in the EFI PCI I/O protocol instances exposed by some UEFI firmwares on x86. I have only build tested this, both on 32 and 64 bit x86. I've tested this on both a devi