fwupd/plugins/uefi
Richard Hughes 26d3da4074 uefi: Fix a libasan failure when reading a UEFI variable
It seems some older versions of libefi var incorrectly build the 'length' value
in the DP returned from efi_generate_file_device_path(). This means we copy past
the end of the allocated buffer when parsing the efi_update_info_t structure.

This bug seems fixed in efivar git master, and this fix is only going to help
people with older efivar versions. It's probably a good thing to be a bit more
paranoid about EFI variable data anyway.

    DEBUG: UpdateInfo:
           ? 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
    ????????????????????????????????????????????????????????????????????????????????????????????????????????
    0x0000 ? 07 00 00 00 20 d9 7b 69 cf 12 a9 4d 83 85 99 69 09 bc 65 59 00 00 05 00 00 00 00 00 00 00 00 00
    0x0020 ? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 01 2a 00 01 00 00 00 00 08 00 00
    0x0040 ? 00 00 00 00 00 40 06 00 00 00 00 00 5a aa 97 5a 10 d5 7e 49 99 0b ca 8d 35 4d c8 6d 02 02 04 04
    0x0060 ? 86 00 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 64 00 6f 00 72 00 61 00 5c 00 66 00 77 00 5c 00
    0x0080 ? 66 00 77 00 75 00 70 00 64 00 2d 00 36 00 39 00 37 00 62 00 64 00 39 00 32 00 30 00 2d 00 31 00
    0x00a0 ? 32 00 63 00 66 00 2d 00 34 00 64 00 61 00 39 00 2d 00 38 00 33 00 38 00 35 00 2d 00 39 00 39 00
    0x00c0 ? 36 00 39 00 30 00 39 00 62 00 63 00 36 00 35 00 35 00 39 00 2e 00 63 00 61 00 70 00 00 00 7f ff
    0x00e0 ? 04 00
    DEBUG: DP type:0x04 subtype:0x01 size:0x002a
    DEBUG: DP type:0x04 subtype:0x04 size:0x0086
    DEBUG: found END_ENTIRE at 0x00aa
    DEBUG: DP length invalid! Truncating from 0x0086 to 0x0080
    DEBUG: DP type:0x7f subtype:0xff size:0x0004
2019-05-02 17:25:34 +01:00
..
efi Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
tests uefi: Add the PCR0 value as the device checksum for system firmware 2018-12-14 19:23:04 +00:00
fu-plugin-uefi.c Never guess the version format from the version string 2019-04-30 09:25:41 +01:00
fu-self-test.c uefi: Fix a libasan failure when reading a UEFI variable 2019-05-02 17:25:34 +01:00
fu-ucs2.c trivial: Ensure all source files include config.h 2018-08-09 14:21:23 +01:00
fu-ucs2.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
fu-uefi-bgrt.c uefi: Do not check the BGRT status before uploading a UX capsule 2019-01-16 13:08:48 +00:00
fu-uefi-bgrt.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
fu-uefi-bootmgr.c Don't upload reports when the user has configured their system in a broken way 2019-04-18 22:06:01 +08:00
fu-uefi-bootmgr.h uefi: Copy the shimx64.efi binary for known broken firmware 2019-03-14 17:00:53 +00:00
fu-uefi-common.c uefi: Don't leak the application build path into the binary 2019-04-17 16:39:29 +08:00
fu-uefi-common.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
fu-uefi-device.c uefi: Fix a libasan failure when reading a UEFI variable 2019-05-02 17:25:34 +01:00
fu-uefi-device.h uefi: Actually upload the UPDATE_INFO entry for the UX capsule 2019-03-15 14:22:01 +00:00
fu-uefi-devpath.c uefi: Fix a libasan failure when reading a UEFI variable 2019-05-02 17:25:34 +01:00
fu-uefi-devpath.h uefi: Fix a libasan failure when reading a UEFI variable 2019-05-02 17:25:34 +01:00
fu-uefi-pcrs.c uefi: More carefully check the output from tpm2_pcrlist 2019-03-27 14:18:19 -04:00
fu-uefi-pcrs.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
fu-uefi-tool.c trivial: Fix fwupdate --apply 2019-04-25 12:52:59 +01:00
fu-uefi-update-info.c uefi: Fix a libasan failure when reading a UEFI variable 2019-05-02 17:25:34 +01:00
fu-uefi-update-info.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
fu-uefi-vars.c uefi: Fix the self tests when running on Fedora SilverBlue 2019-02-26 19:13:35 +00:00
fu-uefi-vars.h Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
meson.build uefi: Fix a libasan failure when reading a UEFI variable 2019-05-02 17:25:34 +01:00
README.md trivial: Add the missing protocol IDs to the plugin READMEs 2019-01-29 22:28:09 +00:00
uefi.conf uefi: Check the amount of free space on the ESP 2018-09-12 13:56:02 +01:00
uefi.quirk uefi: Copy the shimx64.efi binary for known broken firmware 2019-03-14 17:00:53 +00:00

UEFI Support

Introduction

The Unified Extensible Firmware Interface (UEFI) is a specification that defines the software interface between an OS and platform firmware. With the UpdateCapsule boot service it can be used to update system firmware.

If you don't want or need this functionality you can use the -Dplugin_uefi=false option.

Firmware Format

The daemon will decompress the cabinet archive and extract a firmware blob in EFI capsule file format.

See https://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf for details.

This plugin supports the following protocol ID:

  • org.uefi.capsule

GUID Generation

These devices use the UEFI GUID as provided in the ESRT. Additionally, for the system device the main-system-firmware GUID is also added.

For compatibility with Windows 10, the plugin also adds GUIDs of the form UEFI\RES_{$(esrt)}.

UEFI Unlock Support

On some Dell systems it is possible to turn on and off UEFI capsule support from within the BIOS. This functionality can also be adjusted from within the OS by fwupd. This requires compiling with libsmbios support.

When fwupd has been compiled with this support you will be able to enable UEFI support on the device by using the unlock command.

Custom EFI System Partition

Since version 1.1.0 fwupd will autodetect the ESP when it is mounted on /boot/efi, /boot, or /efi. A custom EFI system partition location can be used by modifying OverrideESPMountPoint in /etc/fwupd/uefi.conf.

Setting an invalid directory will disable the fwupd plugin.