Commit Graph

1063 Commits

Author SHA1 Message Date
Richard Hughes
1ca3cdd4d9 Add a pefile firmware parser
This will eventually allow us to reconstruct a SBoM using a UEFI file volume.

This can be used like this `fwupdtool firmware-parse efi/fwupdx64.efi pefile`
to produce:

    <firmware gtype="FuPefileFirmware">
      <data size="0xef59">MZ.</data>
      <firmware>
        <id>.text</id>
        <offset>0x2d0</offset>
        <size>0x7bab</size>
        <data size="0x7bab">H...QRH.=....H.5</data>
      </firmware>
      ...
      <firmware gtype="FuCoswidFirmware">
        <id>fwupd-efi:fwupdx64</id>
        <idx>0x7</idx>
        <version>1.4</version>
        <offset>0xc4e0</offset>
        <size>0xce</size>
        <data size="0xce">..een-US</data>
        <version_scheme>semver</version_scheme>
        <product>fwupdx64</product>
        <summary>EFI helpers to install system firmware</summary>
        <colloquial_version>1.3-7-g881a508</colloquial_version>
        <link>
          <href>https://spdx.org/licenses/LGPL-2.0.html</href>
          <rel>license</rel>
        </link>
        <entity>
          <name>Richard Hughes</name>
          <regid>hughsie.com</regid>
          <role>maintainer</role>
          <role>tag-creator</role>
        </entity>
      </firmware>
    </firmware>
2023-01-06 17:32:59 +00:00
Richard Hughes
10e8f0559b Always search for uSWID data in the image 2023-01-06 14:23:13 +00:00
Richard Hughes
e73f7d019c Do not allow LZX compressed cabinet archives
The GCab decompression code is *scary* low level C that has not had any security
auditing other than by the fuzzer (which found plenty of memory-safety bugs).

Supporting LZX is useless at best, and could be a security exploit at worst.
2023-01-04 16:06:00 +00:00
Josh Soref
67deecde31
Lots of spelling fixes
Fixes:

* activate
* active
* additional
* and
* approaches
* attestation
* bootloader
* calculate
* capability
* children
* close
* compatible
* continuous
* convenience
* critical
* data
* delivery
* disabled
* disambiguate
* documented
* elapse
* emergency
* erasable
* expectations
* filesystem
* from
* haptic
* ignorable
* images
* infinity
* information
* information
* inhibited
* insufficient
* interrupt
* into
* limited
* management
* manifest
* maximum
* memory
* metadata
* mismatch
* model
* nonexistent
* not
* objects
* offset
* omissions
* ota
* past
* perform
* peripherals
* predictable
* product
* quarterly
* quirk
* quirks
* recognize
* release
* requests
* revocation
* sanitized
* sector
* status
* the
* the update
* timeout
* transfer
* transfers
* typically
* unspecified
* upgrade
* which
* will
* wireless
2022-12-29 13:57:31 +00:00
Richard Hughes
de5b2adaab Never allow using SHA-1 for checksum validation 2022-12-29 10:55:08 +00:00
Richard Hughes
427e5cec7a trivial: Add new convenience API to make plugins simpler 2022-12-20 20:54:12 +00:00
Mario Limonciello
2e7355955a trivial: add missing colon in function docs 2022-12-17 07:23:09 -06:00
Richard Hughes
069fa56f1a Add fu_archive_firmware_get_image_fnmatch() for future use
It's useful to get images from archives by a specific filename extension.
2022-12-17 07:44:27 +00:00
Richard Hughes
08e3eaafe0 uefi-dbx: Ignore failure to mount the ESP if unsupported
I think this is only possible when a raw partition with no filesystem has the
ESP or BDP UEFI GUID set in the partition table.
2022-12-16 14:58:03 +00:00
Richard Hughes
ce340e549d trivial: Do not use a GError for a critical problem 2022-12-15 17:27:22 +00:00
Richard Hughes
23cc1ba495 trivial: Fix reading from garbage when getting the pending reboot
Fix the confusion by using a tmp variable.
2022-12-15 17:27:22 +00:00
Richard Hughes
2c5ee07340 trivial: Fix debugging with FU_HID_DEVICE_VERBOSE 2022-12-15 16:41:55 +00:00
Richard Hughes
87ffda474b Allow getting the ESP when there is a block device with no filesystem
Fixes https://github.com/fwupd/fwupd/issues/5313
2022-12-15 08:38:25 +00:00
Richard Hughes
4ef8854618 trivial: Add convenience API for future use 2022-12-13 20:38:49 +00:00
Richard Hughes
83c90262d1 Remove plugin and device GRWLocks
This only have any protective effect if we're using multiple threads -- which
we're not. Removing these unused locks does not affect startup speed, but does
drop the idle RSS by ~10kB.
2022-12-12 17:29:38 +00:00
Richard Hughes
ef6c399a64 Fix a tiny memory leak when probing MEI devices 2022-12-12 17:29:17 +00:00
Richard Hughes
38dfdfd42e Convert FuProgress to a FINAL object
We're not going to subclass this, and making it final saves during startup:

 * 300K calls of fu_progress_get_instance_private()
 * 280K calls of fu_progress_get_step_weighting()
2022-12-11 20:26:15 +00:00
Richard Hughes
a157e3d19d Add fu_version_from_uint24() for future usage 2022-12-11 20:25:52 +00:00
Richard Hughes
c7ab395ff4 Return a more useful error if USB recovery() failed 2022-12-11 20:25:36 +00:00
Richard Hughes
baef005a3c trivial: Add compiler hint that fu_device_build_instance_id() must end in NULL 2022-12-10 14:43:03 +00:00
Richard Hughes
4a29b831fb Mark all MEI devices as internal 2022-12-06 15:10:45 +00:00
Richard Hughes
b521924b00 Make fu_device_get_release_default() match the parent semantics
In various places the code was checking if a release was set, but this would
always be false as the release was being auto-created. This was masking valid
bugs, and was confusing to have the superclass have different semantics to the
baseclass.
2022-11-29 09:05:16 +00:00
Richard Hughes
e02a094ca3 trivial: Fix memory leak when incorporating FuMeiDevice 2022-11-19 12:59:30 +00:00
Mario Limonciello
5d25661727 Add security attribute for OEM specific implementations of BIOS rollback protection 2022-11-18 14:28:13 +00:00
Mario Limonciello
daac8b31da Move AMD platform rollback protection into level 4
This was expected to be used more prevalently than it is being used
in practice.

Link: https://github.com/fwupd/fwupd/issues/5261
2022-11-18 14:28:13 +00:00
Sanjay Sheth
8e32b6a353 New plugin for Logitech Whiteboard camera 2022-11-17 16:42:04 +00:00
Richard Hughes
c79e14d63d Flip around the FuDeviceInstanceFlags logic
Opt-ing 'in' to each both behaviours requires less mental gymnastics compared
to having one flag inverted.
2022-11-04 13:44:23 +00:00
Richard Hughes
32e3241578 Do not add duplicate quirk instance IDs
It's pointless, and just wastes RSS.
2022-11-04 13:44:23 +00:00
Richard Hughes
26e1b7c49b Never hang in g_udev_device_get_parent() if there is never a busnum
Spotted by Coverity.
2022-11-03 23:51:00 -05:00
Richard Hughes
e79f0f23cb trivial: Do not show a critical warning without a request ID
If using old metadata (or when the device does not hard-require an update
message) just use something generic that cannot be replaced client-side.
2022-11-03 15:33:46 +00:00
Richard Hughes
1fafa92218 Ignored root partitions when getting the list of ESPs
Fixes the other half of https://github.com/fwupd/fwupd/issues/5211
2022-11-02 12:27:21 +00:00
Richard Hughes
3e1ce58560 Do not follow symlinks when uing fu_path_get_files()
Fixes half of https://github.com/fwupd/fwupd/issues/5211
2022-11-02 12:27:21 +00:00
Richard Hughes
064da70916 trivial: Fix docs warning for fu_udev_device_find_usb_device() 2022-11-01 16:23:17 +00:00
Richard Hughes
2b64a41dd6 trivial: Don't use _NO_AUTO_INSTANCE_IDS for MEI devices
This doesn't do what we thought it does.
2022-11-01 16:21:39 +00:00
Richard Hughes
6117f88b31 Do not hardcode mei0 for mei_me children 2022-11-01 16:19:27 +00:00
Richard Hughes
7222cafbb1 trivial: Ensure all private MEI instance data is incorporated 2022-11-01 16:19:27 +00:00
Richard Hughes
1f97275a33 Add fu_mei_device_get_fw_status() for future usage
All MEI devices support these attributes, and this API addition will allow us
to support new Intel GPUs and also modernize other plugins.
2022-11-01 16:19:27 +00:00
Richard Hughes
ae99b57b2a trivial: Fix over-constification in fu_udev_device_get_siblings_with_subsystem() 2022-11-01 16:19:27 +00:00
Richard Hughes
ee03652200 trivial: Allow specifying NULL for fu_udev_device_get_parent_with_subsystem() 2022-11-01 16:19:27 +00:00
Mario Limonciello
60c01af01c trivial: add missing log domain for efi signature list
Noticed this missing in https://github.com/fwupd/fwupd/issues/5211
2022-10-28 13:18:48 -05:00
Richard Hughes
912a578411 trivial: Be less verbose when parsing IHEX files 2022-10-27 15:29:45 +01:00
Richard Hughes
7a481183ee trivial: interpolate correctly when the old value is exactly zero 2022-10-27 15:29:32 +01:00
Richard Hughes
6547696efb trivial: Only ignore progress steps when they are all nonzero 2022-10-27 15:29:32 +01:00
Richard Hughes
b50b67107f Add fu_progress_to_string() to make debugging easier 2022-10-27 15:29:32 +01:00
Richard Hughes
577a512ce1 trivial: Fix the dell self tests with the new GUsb installed 2022-10-27 14:49:55 +01:00
Richard Hughes
ac48c865a0 Add a helper to get a GUsbDevice from a FuUdevDevice 2022-10-26 23:27:50 +01:00
Richard Hughes
2c321ac29b Emit a critical warning if a plugin tries to use HWIDs in ->init()
The HWIDs are only available for ->setup() and ->coldplug().
2022-10-25 10:46:29 -05:00
Richard Hughes
e8eaca0051 Save the ONLY_QUIRK instance IDs to fix incorporation of i2c
The baseclass is calling fu_device_build_instance_id_quirk() and when we
incorporate the device we were only copying the 'proper' instance IDs and not
the ones used for quirk matching -- which we need to match the devices that use
keys containing MODALIAS for the Plugin key to be set.
2022-10-25 15:39:30 +01:00
Richard Hughes
7c4398615e trivial: Watch the plugin config even if there's no ->startup() 2022-10-25 06:54:08 -05:00
Richard Hughes
5987a9691a Ensure the configure file is correct for built-in plugins
The fu_plugin_open() function is only called for modular plugins.
2022-10-25 06:54:08 -05:00