Commit Graph

3220 Commits

Author SHA1 Message Date
Richard Hughes
0c80952e30 synaptics-mst: Check the firmware payload size when updating cayenne
PVS: Parameter 'payload_len' is always rewritten in function body before being used.
2022-09-09 19:22:58 +01:00
Richard Hughes
07b368d6b1 vbe: Fix a crash when dumping firmware
PVS: The null pointer is passed into 'g_byte_array_append' function.
2022-09-09 18:50:56 +01:00
Dylan Van Assche
c62e7a6bab android-boot: fix segfault
Store strings during the lifetime of the plugin and free them
when destroyed.
2022-09-09 16:16:50 +01:00
Richard Hughes
5f554d1668 ccgx: Write all the metadata block as intended
PVS: It's odd that 'sizeof()' operator evaluates the size of a pointer to a
class, but not the size of the 'metadata' class object.
2022-09-09 06:42:51 -05:00
Richard Hughes
5ebc3b6ad9 Move the generic Intel Goshen Ridge code out to a new plugin
The original code was written by Dell for the dell-dock plugin, but
it's exactly the same code and NVM format for Intel reference hardware.
2022-09-08 09:56:33 +01:00
Richard Hughes
fc3ac81978 Load coSWID metadata from a uSWID MTD block device
The coSWID is a child of the parent, and the parent container does not have a
version. Also fix a small memory leak when parsing container formats.

Fixes https://github.com/fwupd/fwupd/issues/4294
2022-09-07 16:02:27 +01:00
Mario Limonciello
d6a455e856 trivial: try harder to make sure mtdram is set up
the autopkgtest environment in Ubuntu seems to not be preparing the mtdram
device properly. Sometimes the udev node "exists" but the /dev/mtd0 does not
exist.

Look for this explicitly and skip the test if it happens.
2022-09-07 08:24:10 -05:00
Mario Limonciello
cc8b4905ef trivial: only build thunderbolt for x86 architectures
It's true that the USB4 spec won't require x86, but a recent autopkgtest
failure on powerpc doesn't make sense to debug.  You won't ever see TBT
in a powerpc machine.

We can loosen this to any non-x86 architectures later that DO prove to
have support for USB4 add-in cards.
2022-09-07 08:05:08 -05:00
Richard Hughes
f9de0ee2f9 android-boot: Quirk data is available as soon as the instance ID has been added 2022-09-06 21:28:58 +01:00
Richard Hughes
0b8640929c android-boot: Only add the device if updatable
Otherwise we get devices like:

    ├─EFI\x20system\x20partition:
    │     Device ID:          003a0352e13dc2defe8548eb541d56067e5e5d71
    │     Summary:            Android Bootloader
    │     Current version:    0.0.0
    │     GUIDs:              a4001789-0ca9-5f4c-8c53-e65f8ec8a825
    │                         9d825eae-ef58-501c-944f-6a0a8d9cfb49
    │     Device Flags:       • Internal device
    │                         • System requires external power source
    │                         • Needs a reboot after installation
    │                         • Cryptographic hash verification is available
2022-09-06 21:28:58 +01:00
Richard Hughes
26e029756c android-boot: Don't set the GError if not checking return code 2022-09-06 21:28:58 +01:00
Dylan Van Assche
d0d4b17a7f plugins: android-boot: new plugin
Add a plugin for supporting Android bootloaders which are used on
all Qualcomm-based Android devices. These bootloaders are stored on
their own partitions and the partition table cannot be altered on
Qualcomm devices. This plugin supports any block device, but only
exposes the ones defined in the quirk file as updatable.
2022-09-05 17:59:11 +01:00
Richard Hughes
92db5fc87a modem-manager: Fix a critical warning when issuing Secure Boot AT commands
Fixes https://github.com/fwupd/fwupd/issues/4998
2022-09-05 17:53:27 +01:00
Andrii Dushko
e6e17a69d7
corsair: remove support for some devices
Vendor has decided to remove these devices from the initial supported
device list:
    * KATAR PRO WIRELESS mouse
    * HARPOON RGB WIRELESS mouse
2022-09-02 14:39:19 +03:00
Andrii Dushko
330a67b5fe corsair: add SABRE RGB PRO Gaming mouse 2022-09-01 11:41:49 +01:00
Mario Limonciello
bfa54d06ef trivial: lenovo-thinklmi: don't assume boot order lock means plugin runs
Lenovo could drop this some day and this plugin has other reasons to run
now. So instead match a HWID for Lenovo systems.
2022-08-31 09:21:07 -05:00
Mario Limonciello
ea64db7d19 lenovo-thinklmi: Disable changing sleep mode on Ryzen 6000 systems
S3 is not supported by AMD and is not exposed in the GUI on these
systems.  Lenovo however exports it to their WMI interface and changing
it will means it can only be changed from the OS.
2022-08-31 09:21:07 -05:00
Richard Hughes
6fd7a62efe uf2: Fix a small memory leak when parsing files
Fixes https://oss-fuzz.com/testcase-detail/4617823934087168
2022-08-30 17:34:33 +01:00
Richard Hughes
16b463334e Export the generic Intel Thunderbolt firmware format
This is being used for other products, e.g. USB4 docks.

If non-Intel firmware is being used (e.g. ASMedia) then the explicit
calls to `fu_intel_thunderbolt_nvm_new()` can be changed to something
like `fu_firmware_new_from_gtypes()` with all the formats listed.
2022-08-30 14:20:14 +01:00
victor-cheng
42e3c2e4dd usi-dock: Extend delay time before reload
sometimes the device is busy and will exceed the timer limit.
2022-08-30 10:28:15 +01:00
Josh Chen
5ed675f93b elantp: fix missing initial value and remove duplicate code 2022-08-29 21:18:40 -05:00
Richard Hughes
cc30929339 Correctly detect CET IBT
According to Intel, EDX[bit 20] corresponds to IBT feature, *not* ECX.

Fixes half of https://github.com/fwupd/fwupd/issues/4960
2022-08-29 14:40:47 +01:00
Mario Limonciello
1f7526cce1 tpm: Don't require uefi capsule updates for checking TPM PCR0
There isn't any reason that we need to have a system advertising a
GUID with `main-system-firmware` in order to check that PCR0 reconstruction
matches what the TPM actually has.

Fixes: #4961
2022-08-29 07:56:23 +01:00
Richard Hughes
eec6de6985 Fix applying the latest DBX update on machines with 20200729.x64 installed
Use a hardcoded list of last-set dbx checksums to fix the reported version
when required.
2022-08-26 16:29:28 +01:00
Richard Hughes
2a231896fd trivial: Fix a couple of coding style issues 2022-08-25 12:04:25 +01:00
Richard Hughes
2fed9cde72 trivial: Fix one -Wunused-variable warning 2022-08-25 12:03:51 +01:00
Josh Chen
fa7b6247bb Added support for absolute reporting (non-HID) devices 2022-08-25 11:53:30 +01:00
Richard Hughes
b436bbee58 Only fail the kernel tainted HSI test for specific taint reasons
For example, working around a firmware bug in the kernel isn't really
what the HSI attribute was intended to measure.
2022-08-24 13:35:55 +01:00
Mario Limonciello
b7b0ce533d trivial: Unify ambiguity between bios-attrs and bios-settings
These are currently used interchangeably since there was indecisiveness
which to use as the feature was being developed.

As outward facing it will be named with "settings", change all uses
in the code to match this.
2022-08-24 07:20:01 -05:00
Richard Hughes
4e5a928d91 pci-mei: Update vulnerable CMSE versions from CSMEVDT data 2022-08-24 10:30:39 +01:00
Richard Hughes
326042b9b2 pci-mei: Recognize CSME version 16
Fixes https://github.com/fwupd/fwupd/issues/4927
2022-08-24 10:30:39 +01:00
Richard Hughes
6aec72d58a Allow self tests to pass when run in LXC zones
Fixes https://github.com/fwupd/fwupd/issues/4684
2022-08-22 12:46:36 +01:00
Mario Limonciello
2705179117 Convert HSI into a meson tristate-feature
This allows us to disable it automatically on architectures that
aren't supported and OSes that aren't supported.

Link: https://bugs.launchpad.net/ubuntu/+source/fwupd/+bug/1987067
2022-08-22 06:03:38 -05:00
Mario Limonciello
c4fb8f5eb4 trivial: Add new modalias instance IDs for some elan touchpads 2022-08-22 06:03:19 -05:00
Sean Rhodes
a4a1be569b
plugins/{superio,flashrom}: Add LabTop Mk III HwId (#4920)
Add the HwId for the Star LabTop Mk III when using coreboot firmware,
as this differs to AMI.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-08-12 14:00:50 +00:00
Boris Mittelberg
b48cd9fea6 cros-ec: adding stay-in-ro command if EC is in bootloader 2022-08-10 19:06:58 +01:00
victor-cheng
28357f7528
usi-dock: Add support for ThinkPad Thunderbolt 4 and Universal Smart Dock
Use distinguishing displayed names by CID.
2022-08-10 09:31:16 +01:00
Sean Rhodes
639493259d
plugins/flashrom: Skip BC check for coreboot devices (#4892)
Set BcrAddr to 0x0 for all coreboot devices, so that the check of
BIOS Control is skipped as coreboot won't forcibly set this.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2022-08-02 10:11:55 -05:00
Sean Rhodes
2af92e0b3d Revert "plugins/intel-spi: Correct BIOS Control Device (#4742)"
This reverts commit 6a1ceebd4c.
2022-08-01 11:09:46 +01:00
Richard Hughes
77006b75eb Set the target value on the security attribute
Semantically it is the desire of the security attribute, not the bios
attribute, i.e. you could imagine that a specific attribute would have
to be *foo or bar or baz* for HSI-1 and *only foo* for HSI-2

Also make it easier to add possible BIOS attribute target values in
plugin code.
2022-08-01 07:12:18 +01:00
Mario Limonciello
9ec72eca1a trivial: acpi-facp: Link FwupdBiosAttr to FwupdSecurityAttr for S2idle
Lenovo Z13 offers to change this using "SleepState".
2022-07-29 11:31:50 -05:00
Mario Limonciello
e07eb9afab trivial: pci-psp: Link FwupdBiosAttr to FwupdSecurityAttr when TSME off
Lenovo Z13 offers a BIOS setting called "TSME" that can be potentially
controlled from firmware-attributes API.
2022-07-29 11:31:50 -05:00
Mario Limonciello
64df25d0e7 iommu: map out the known BIOS attributes for IOMMU
This will let fwupd clients offer to change the BIOS setting for
IOMMU.

"IOMMU" -> Lenovo P620
"VtForDirectIo" -> Dell XPS 9310
"AmdVt" -> Lenovo P14s
2022-07-29 11:31:50 -05:00
Mario Limonciello
803967289c uefi-capsule: Set FwupdBiosAttr ID for when secure boot is turned off
Lenovo and Dell both use the same key name 'SecureBoot' for this
functionality.
2022-07-29 11:31:50 -05:00
Mario Limonciello
c0b0a77e21 trivial: make the lenovo plugin only look for thinklmi attributes
This ensures that even if Dell introduces a BootOrderLock attribute
it will not match.
2022-07-29 11:31:50 -05:00
Richard Hughes
47efacfe5d Remove the firmware builder functionality
We used the firmware builder functionality to either build or modify
firmware images on the end-user system, e.g. copying the MAC address
from the old system image to the new system image.

Unfortunately running fwupd on the command line (e.g. ./src/fwupd)
leaves the tty connected and thus bubblewrap doesn't protect us from
installing malicious signed firmware. The firmware would have to have
been uploaded to the LVFS by a trusted vendor and signed before being
installed, which further decreases the severity of this problem.

As there was only one vendor who asked for this functionality (who have
yet to upload a single firmware to the LVFS...) just rip out this
functionality to reduce our attack surface and completely fix the bug,
and any like it.

Many thanks to Aaron Janse <aaron@ajanse.me> for discovering and
disclosing this issue to us.
2022-07-29 16:52:38 +01:00
Ivan Mikhanchuk
c14129a149 modem-manager: add Quectel secure boot status AT commands 2022-07-29 09:32:56 +01:00
Mario Limonciello
f755f55e4c lenovo-thinklmi: convert to use new firmware attributes API 2022-07-28 17:30:57 -05:00
Mario Limonciello
9289e7d817 trivial: set firwmare attributes class directory for all tests
We don't want the system's firmware attributes class directory to
conflict.
2022-07-28 17:30:57 -05:00
Richard Hughes
a307f60984 trivial: Show what the user should do for IOMMU failure 2022-07-28 16:45:13 +01:00