mbox series

[v4,0/4] Ignore unrealistically large option roms in EFI stub code

Message ID 20180429110623.13949-1-ard.biesheuvel@linaro.org
Headers show
Series Ignore unrealistically large option roms in EFI stub code | expand

Message

Ard Biesheuvel April 29, 2018, 11:06 a.m. UTC
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.

Changes in v4:
- Deduplicate the 32 and 64 bit code paths so that the actual change needs
  to be applied only once. This requires some preparatory work (#1, #2, #3),
  of which the first one should go to -stable.

Changes in v3:
- Limit the rom-size to 16MiB to match the EFI spec

Changes in v2:
- Add the check to both __setup_efi_pci32 and __setup_efi_pci64 instead of
  only to __setup_efi_pci64, some CHT devices which need this still use a
  32 bit UEFI

[0] https://marc.info/?l=linux-efi&m=152494632116321

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

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

 arch/x86/boot/compressed/eboot.c | 112 ++++++--------------
 include/linux/efi.h              |  14 +--
 2 files changed, 39 insertions(+), 87 deletions(-)

-- 
2.17.0
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Hans de Goede May 1, 2018, 9:48 a.m. UTC | #1
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 device with a 32 bit UEFI and on a device with
a 64 bit UEFI, using a 64 bit kernel on both cases. The second device also
used to show the "failed to alloc mem for rom" errors and I can confirm
this series fixes this:

Tested-by: Hans de Goede <hdegoede@redhat.com>


Regards,

Hans



> 

> Changes in v4:

> - Deduplicate the 32 and 64 bit code paths so that the actual change needs

>    to be applied only once. This requires some preparatory work (#1, #2, #3),

>    of which the first one should go to -stable.

> 

> Changes in v3:

> - Limit the rom-size to 16MiB to match the EFI spec

> 

> Changes in v2:

> - Add the check to both __setup_efi_pci32 and __setup_efi_pci64 instead of

>    only to __setup_efi_pci64, some CHT devices which need this still use a

>    32 bit UEFI

> 

> [0] https://marc.info/?l=linux-efi&m=152494632116321

> 

> 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

> 

> Hans de Goede (1):

>    efi/x86: Ignore unrealistically large option roms

> 

>   arch/x86/boot/compressed/eboot.c | 112 ++++++--------------

>   include/linux/efi.h              |  14 +--

>   2 files changed, 39 insertions(+), 87 deletions(-)

> 

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ard Biesheuvel May 1, 2018, 10:17 a.m. UTC | #2
On 1 May 2018 at 11:48, Hans de Goede <hdegoede@redhat.com> 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 tested this, both on 32 and 64 bit x86.

>

>

> I've tested this on both a device with a 32 bit UEFI and on a device with

> a 64 bit UEFI, using a 64 bit kernel on both cases. The second device also

> used to show the "failed to alloc mem for rom" errors and I can confirm

> this series fixes this:

>

> Tested-by: Hans de Goede <hdegoede@redhat.com>

>


Thanks Hans

I have queued this up in efi/next with your tested-by
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html