Commit Graph

46 Commits

Author SHA1 Message Date
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
f12068d2e9 Allow devices to only accept version upgrades
See https://github.com/fwupd/fwupd/issues/3554 for details.
2021-07-31 20:41:21 +01:00
Mario Limonciello
798d1ed3ee trivial: update markdown for pre-commit style 2021-07-18 14:42:47 -05:00
Richard Hughes
9c31d1fadd trivial: Set the FuContext on more devices 2021-07-12 19:01:55 +01:00
Richard Hughes
d4bd5cca5a Standardize some of the device summary text
This is supposed to be 'Sentence case' with no trailing fullstop.
2021-07-09 07:07:07 +01:00
Richard Hughes
f6cd676fef trivial: Add required dep for dbxtool 2021-06-15 11:45:16 +01:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Richard Hughes
c4bc709359 Do not use help2man to build manual pages
This prevents problems when cross compiling. Using help2man is now also of
limited use; if we can just tell the user to use --help we do not need to keep
the manual in sync.

It also allows us to drop the several other supporting files that we use when
the help2man output isn't actually that useful.

Fixes https://github.com/fwupd/fwupd/issues/3025
2021-04-11 13:42:04 +01:00
Richard Hughes
7f6f525f21 Add fu_bytes_get_data_safe() to check for zero sized data
Fixes https://github.com/fwupd/fwupd/issues/3122
2021-04-10 13:20:07 +01:00
Richard Hughes
1981c63d58 Remove FuFirmwareImage and just use FuFirmware instead
This allows us to 'nest' firmware formats, and removes a ton of duplication.

The aim here is to deprecate FuFirmwareImage -- it's almost always acting
as a 'child' FuFirmware instance, and even copies most of the vfuncs to allow
custom types. If I'm struggling to work out what should be a FuFirmware and
what should be a FuFirmwareImage then a plugin author has no hope.

For simple payloads we were adding bytes into an image and then the image into
a firmware. This gets really messy when most plugins are treating the FuFirmware
*as* the binary firmware file.

The GBytes saved in the FuFirmware would be considered the payload with the
aim of not using FuFirmwareImage in the single-image case.
2021-03-09 21:14:12 +00:00
Richard Hughes
b3f9841924 Support more than one protocol for a given device
Devices may want to support more than one protocol, and for some devices
(e.g. Unifying peripherals stuck in bootloader mode) you might not even be able
to query for the correct protocol anyway.
2021-03-01 16:14:36 +00:00
Richard Hughes
078beafb2d Add a new internal flag to opt-in to GUID matching
It is far too easy to forget to set FWUPD_DEVICE_FLAG_NO_GUID_MATCHING for new
plugins, and without it it all works really well *until* a user has two devices
of the same type installed at the same time and then one 'disappears' for hard
to explain reasons. Typically we only need it for replug anyway!

Explicitly opt-in to this rarely-required behaviour, with the default to just
use the physical and logical IDs. Also document the update behavior for each
plugin to explain why the flag is being used.

This allows you to have two identical Unifying plugged in without one of them
being hidden from the user, at the same time allowing a HIDRAW<->USB transition
when going to and from bootloader and runtime modes.

This removes the workaround added in 99eb3f06b6.

Fixes https://github.com/fwupd/fwupd/issues/2915
2021-02-25 15:47:25 +00:00
Richard Hughes
a22c13c637 Move the plugin build logic to the plugins themselves 2021-02-18 14:46:20 +00:00
Mario Limonciello
75835b4a0b Use FWUPD_COMPILATION define to indicate an in tree build
When this is done, include:
* Including the hash
* Including anything that is not ABI stable in plugins yet

Suggested-by: Simon McVittie <smcv@debian.org>
2021-01-22 14:01:25 -06:00
Richard Hughes
fdb3a83a20 uefi-dbx: Ignore the legacy OVMF dummy GUID for the version
This was changed recently in https://sourceforge.net/p/edk2/code/29270/
2021-01-08 14:54:31 +00:00
Richard Hughes
5c9b1fcc81 Only include the start year in the copyright header
The end year is legally and functionally redundant, and more importantly causes
cherry-pick conflicts when trying to maintain old branches. Use git for history.
2021-01-07 14:48:16 +00:00
Richard Hughes
5c9e9f17c5 libfwupdplugin: Export FuEfiSignatureList for plugins to use 2021-01-05 16:42:58 +00:00
Richard Hughes
59b6b6d2c5 uefi-dbx: Fix a critical warning when parsing invalid firmware 2021-01-05 15:59:30 +00:00
Richard Hughes
ee2e2c3674 uefi: Rename to uefi-capsule
Rename the plugin to make it clearer of the scope.

Based on a patch from Mario Limonciello <mario.limonciello@dell.com>
2021-01-05 15:31:22 +00:00
Richard Hughes
fcb5667d79 libfwupdplugin: Subclass FuFirmware in FuEfiSignatureList
This allows us to get fuzzing support 'for free' and also simplifies the code.
2021-01-05 14:45:31 +00:00
Richard Hughes
eddaed0c11 Allow specifying more than one VendorID for a device
Asking the user for the UID mapping isn't working very well, as it requires lots
of manual handholding. It also doesn't work very well when the device vendor
does not actually have a PCI ID or if the vendor has split into two entities.

Just use the OUI address as an additional VendorID and match any of the device
IDs against any of the metadata-supplied values.
2021-01-04 22:30:20 +00:00
Richard Hughes
c4ca8e25d1 Use honggfuzz to fuzz firmware rather than AFL
This has better multi-core performance and can run in persistent mode -- which
allows us to construct a test harness of all the parsers (which takes time) and
then just reuse the process for lots of different data.
2020-12-11 09:37:42 +00:00
Richard Hughes
386f2c1d39 uefi-dbx: Fix a trivial buffer over-read when fuzzing 2020-12-08 20:50:55 +00:00
Richard Hughes
c1e5f94e5c Mark more user-visible strings as translatable
Fixes https://github.com/fwupd/fwupd/issues/2616
2020-11-29 07:09:31 +00:00
Richard Hughes
49c2a78c99 Include the amount of NVRAM size in use in the LVFS failure report 2020-10-27 13:58:40 +00:00
Mario Limonciello
8aa5d41eb7 Add external interface messages 2020-10-26 12:05:20 -05:00
Richard Hughes
e9ada9ed72 uefi-dbx: Remove three unhelpful lines of debugging 2020-10-01 16:39:10 +01:00
Richard Hughes
deabfc5012 uefi-dbx: Do not upload a failure report for a failed dbx check
Use one of the errors mapping to FWUPD_UPDATE_STATE_FAILED_TRANSIENT to avoid
uploading a failure report for something the user has to fix, i.e. update the
distro shim package.
2020-09-29 13:15:50 +01:00
Richard Hughes
9b688d0b73 trivial: Set FWUPD_STATUS_DECOMPRESSING when preparing firmware
This avoids the plugins forgetting to do it themselves.
2020-09-08 14:18:46 +01:00
Mario Limonciello
5de5dd3582 Install the installed tests
Move binaries out of fwupd tree to https://github.com/fwupd/fwupd-test-firmware

Fixes some of https://github.com/fwupd/fwupd/issues/1956
2020-08-28 10:10:43 -05:00
Mario Limonciello
82c3e3471d Remove support for UEFI dbx security attribute
This is no longer relevant as fwupd is providing dbxtool now.
2020-08-19 07:38:51 +01:00
Richard Hughes
58ba785915 Install the new dbx utility as fwupdbxtool 2020-08-18 17:34:26 +01:00
Richard Hughes
1abb32c623 uefi-dbx: Validate the dbx update is safe to apply
To do this mount all ESP partitions and check all the binaries there to see if
they match any entries in the new dbx. If we applied the update when a hash
matched, we would unintentially 'brick' the users machine, as the grub and shim
binaries *have* to be updated first.

This functionality does reimplement the PE hashing functionality found in
sbsigntools and pesign. This was done for 4 main reasons:

 * There were some memory safety issues found when fuzzing random binaries
 * Executing the tools hundreds of times was a lot of overhead
 * Operating from a blob of immutable mmap'd memory is much faster
 * We only need a very small amount of functionality from both tools
2020-08-17 15:59:02 +01:00
Richard Hughes
0e7102c4f8 uefi-dbx: Fix some NULL/FALSE confusion 2020-08-17 14:47:58 +01:00
Richard Hughes
01d5779597 uefi-dbx: Allow updating the dbx using the LVFS
The GUID is built using the SHA256 of the certificates in the KEK.
2020-08-14 13:22:53 +01:00
Richard Hughes
edc3432338 dbxtool: List the checksums correctly for multiple EFI_SIGNATURE_LISTs
Fixes https://github.com/fwupd/fwupd/issues/2319
2020-08-13 21:19:10 +01:00
Richard Hughes
361114784b Add a compatible re-implementation of the rhboot dbxtool 2020-08-13 19:09:40 +01:00
Richard Hughes
99dda53cc2 trivial: Define one more EFI GUID 2020-08-12 15:13:09 +01:00
Richard Hughes
a852254d92 trivial: Hide the UEFI DBX parsing by default 2020-07-03 12:32:06 +01:00
Richard Hughes
85226fd9d1 Remove potentially problematic language
Red Hat wants to drive an initiative in correcting problematic and potentially
divisive language in open source projects. These naming conventions and
descriptive phrases are hurtful and offensive to many of our colleagues across
the open source universe.

See https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language
2020-06-30 17:31:17 +01:00
Richard Hughes
b246bcaecb Allow client tools to translate the HSI attributes and results
To do this, rely on the AppStream ID to map to a translated string (providing a
fallback for clients that do not care) and switch the free-form result string
into a set of enumerated values that can be translated.

This fixes some of the problems where some things have to be enabled to "pass"
and other attributes have to be some other state. For cases where we want the
user to "do" something, provide a URL to a wiki page that we update out-of-band
of fwupd releases.
2020-05-18 17:03:49 +01:00
Richard Hughes
cae111d1de Save the plugin that created the FwupdSecurityAttr
This is really useful for debugging.
2020-05-15 16:17:27 +01:00
Mario Limonciello
05b9eb5936 trivial: remove an extra colon at the end of uefi-dbx error 2020-05-14 15:40:24 -05:00
Richard Hughes
c1eda7d516 Add many new plugins to support for the Host Security ID
The HSI specification is currently incomplete and in active development.

Sample output for my Lenovo P50 Laptop:

    Host Security ID: HSI:2+UA!

    HSI-1
    ✔  UEFI dbx: OK
    ✔  TPM: v2.0
    ✔  SPI: Write disabled
    ✔  SPI: Lock enabled
    ✔  SPI: SMM required
    ✔  UEFI Secure Boot: Enabled

    HSI-2
    ✔  TPM Reconstruction: Matched PCR0 reading

    HSI-3
    ✘  Linux Kernel S3 Sleep: Deep sleep available

    HSI-4
    ✘  Intel CET: Unavailable

    Runtime Suffix -U
    ✔  Firmware Updates: Newest release is 8 months old

    Runtime Suffix -A
    ✔  Firmware Attestation: OK

    Runtime Suffix -!
    ✔  fwupd plugins: OK
    ✔  Linux Kernel: OK
    ✔  Linux Kernel: Locked down
    ✘  Linux Swap: Not encrypted
2020-05-12 21:20:18 +01:00
Mario Limonciello
cb6ec2b18e trivial: uefi-dbx: correct error message on missing file
```
unset error in plugin uefi_dbx for add_security_attrs()
```
2020-05-07 13:02:57 -05:00
Richard Hughes
b9640a28ec uefi-dbx: Add a plugin that analyses the UEFI dbx variable
This will be used for future functionality.
2020-05-07 16:59:36 +01:00