Commit Graph

2149 Commits

Author SHA1 Message Date
Richard Hughes
ed0af24406 trivial: Use fwupd_device_remove_flag() to remove a single flag 2021-02-22 22:48:56 +00:00
Chris Coulson
cfd1f2f42a uefi-capsule: Ensure SBAT metadata is added correctly
The current approach of adding SBAT metadata after linking is creating
an image that is badly formed in 2 ways:

 * The SBAT section's file offset and size are not a multiple of the
   file alignment.

 * The SBAT section has a virtual address of zero. EDK2 loads the header
   here, and so it gets rejected.

This changes the approach to match shim, where an object file is
created with a .sbat section and then the linker takes care of placing
the section at a more appropriate virtual address.

See https://github.com/vathpela/gnu-efi/pull/14 for the section addition.
2021-02-22 16:19:19 +00:00
Richard Hughes
a647ae05d1 synaptics-mst: Do not allow updating a device with no customer ID
This is typically when the OEM is using the reference hardware design.

Prevent updates, as there might be a new bug introduced in the reference
firmware that only manifests on one OEM's product. It's up to the OEM to do the
testing and validation.

We need something to tie it back to a physical device model if it's using a
reference firmware and we want to update it.
2021-02-22 15:53:58 +00:00
Richard Hughes
a76de3279b Add a test BLE plugin for a demo 2021-02-22 16:53:41 +01:00
Richard Hughes
5f9e4730f1 synaptics-mst: Read the customer ID (board ID) in a more safe way
Also split out the firmware parsing to an object so we can check the firmware
using firmware-parse and also fuzz it.

See also: https://github.com/fwupd/fwupd/issues/1665
2021-02-22 13:57:34 +00:00
Chang Po-Hung
86d3c58e3b Add cheetos quirk in pixart-rf 2021-02-20 07:28:51 +00:00
JimmyYu
6934656959 pixart: Fix more supported PID 2021-02-19 09:06:58 +00:00
Richard Hughes
9df6764d93 uefi-capsule: Set the component generation to 1
See https://github.com/rhboot/shim/blob/main/SBAT.md
2021-02-18 13:23:18 -06:00
Richard Hughes
ec52942bc5 uefi-capsule: Include all the sections when using objcopy
Fixes the regression introduced in fde4b1676a
2021-02-18 13:23:18 -06:00
Richard Hughes
b4496cae81 tpm-eventlog: Fix a possible crash if not using _new() 2021-02-18 16:56:40 +00:00
Richard Hughes
2e1245728f Call the superclass directly from subclassed devices
This allows a device subclass to call the parent method after doing an initial
action, or even deliberately not call the *generic* parent method at all.

It also simplifies the plugins; you no longer have to remember what the plugin
is deriving from and accidentally clobber the wrong superclass method.
2021-02-18 16:18:34 +00:00
Richard Hughes
a22c13c637 Move the plugin build logic to the plugins themselves 2021-02-18 14:46:20 +00:00
Richard Hughes
90254a5152 csr: Rename plugin to dfu-csr as it depends on the prefixed plugin 2021-02-18 14:46:20 +00:00
Mario Limonciello
d2130f73a3 trivial: Rename meson option tpm->plugin_tpm 2021-02-18 14:46:20 +00:00
JimmyYu
d6cf611861 pixart: Modify the README content 2021-02-18 09:11:35 +00:00
JimmyYu
8e10abf308 pixart: Add more supported pixart devices 2021-02-18 09:11:35 +00:00
JimmyYu
618fae792f pixart: Re-define var and Guid 2021-02-18 09:11:35 +00:00
Richard Hughes
a52dc06841 ccgx: Add FuFirmware->write() for DMC firmware so the parser can be fuzzed
This also fixes all the of the big endian bugs when parsing firmware.
2021-02-17 08:53:37 +00:00
Richard Hughes
49527b76ca ccgx: Allow turning off the checksum verification 2021-02-17 08:53:37 +00:00
Richard Hughes
645a62002e pixart: Add some error prefixes to aid debugging 2021-02-17 08:48:45 +00:00
Richard Hughes
63a9665107 pixart: Fuzz the firmware parser 2021-02-17 08:48:45 +00:00
Richard Hughes
7fb4397f25 pixart: Set firmware version raw 2021-02-17 08:48:45 +00:00
JimmyYu
b7551c0211 pixart: Add support for more devices 2021-02-17 08:48:45 +00:00
Richard Hughes
f9cb8f3404 rts54hub: Add defines for the vendor commands 2021-02-17 08:41:06 +00:00
Richard Hughes
74db289c36 f 2021-02-17 15:25:41 +08:00
RickyWu
65f2fab869 rts54hub: Add child device of a RTD21xx HDMI converter 2021-02-17 15:25:41 +08:00
Lars Wendler
4a62482708 system76-launch plugin requires gusb
Otherwise the following build error happens:

  ../fwupd-1.5.6/plugins/system76-launch/fu-system76-launch-device.c:117:9: error: ‘G_USB_DEVICE_CLAIM_INTERFACE_BIND_KERNEL_DRIVER’ undeclared (first use in this function)
    117 |         G_USB_DEVICE_CLAIM_INTERFACE_BIND_KERNEL_DRIVER,
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ../fwupd-1.5.6/plugins/system76-launch/fu-system76-launch-device.c:133:11: error: ‘G_USB_DEVICE_CLAIM_INTERFACE_BIND_KERNEL_DRIVER’ undeclared (first use in this function)
    133 |           G_USB_DEVICE_CLAIM_INTERFACE_BIND_KERNEL_DRIVER,
        |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-02-16 10:40:36 -06:00
Richard Hughes
86c6c2d4a3 Add fu_firmware_set_version_raw()
A few plugins need this now, so move it into the base class.
2021-02-16 15:24:29 +00:00
Richard Hughes
5018d14dcd trivial: Remove executable permission on a C source file... 2021-02-16 12:26:28 +00:00
Richard Hughes
6d656a940d Allow building without SBAT metadata
Two reasons:

 * It seems a bit antisocial to hard-require all this data without fair warning
 * The aarch64 pesign crashes when trying to sign the binary with SBAT metadata
2021-02-16 11:04:47 +00:00
Richard Hughes
f572a012f6 synaprom: Set a sane limit on the number of images that can be added
This fixes a timeout found by oss-fuzz.
2021-02-16 08:57:15 +00:00
Sean Rhodes
9840c54021 Adjusted superio L4 quirk 2021-02-15 22:24:40 +00:00
Richard Hughes
4822b3317b ccgx: Check for FPE when parsing the metadata section 2021-02-15 16:47:27 +00:00
Richard Hughes
124f2295ee trivial: Untie efi_os_dir from the SBAT distro ID
We happily fallback with an unset -Defi_os_dir and it gets confusing explaining
why the EFI dir needs to be set on a non-supported system.

In practice they'll probably have the same eventual value on most supported
distributions.

Fixes https://github.com/fwupd/fwupd/issues/2873
2021-02-12 16:01:00 +00:00
Richard Hughes
6a33d2d99e ccgx: Fix division by zero for invalid firmware 2021-02-12 13:54:01 +00:00
Javier Martinez Canillas
17c0a6c239 uefi-capsule: Fix objcopy failing to add a .sbat section on aarch64
The objcopy tool only has support for pei-x86_64 and pei-i386 targets, and
so trying to add a .sbat section for fwupdaa64.efi fails with this error:

objcopy: plugins/uefi-capsule/efi/fwupdaa64.efi: file format not recognized

To fix this issue, add the .sbat section to the ELF fwup.so shared object
and keep that section when generating the resulting fwupdaa64.efi binary.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-02-12 13:29:55 +00:00
Richard Hughes
54bc512388 Add firmware flags for presence of CRC and VID/PID 2021-02-11 20:27:20 +00:00
Richard Hughes
b242fe4870 ccgx: Implement FuFirmware->build() to add fuzzing support 2021-02-11 14:53:43 +00:00
Richard Hughes
87a8091bed trivial: Fix a crash using fu_firmware_image_get_chunks()
Add a GError as it can return NULL for invalid circumstances. It's okay to
change the API as this symbol has not yet been in a tarball release.
2021-02-11 13:13:06 +00:00
Javier Martinez Canillas
378b00018b uefi-capsule: Add SBAT metadata to the fwupd EFI binary
The Secure Boot Advanced Targeting (SBAT) [0] is a Generation Number Based
Revocation mechanism that is meant to replace the DBX revocation file list.

Binaries must contain a .sbat data section that has a set entries, each of
them consisting of UTF-8 strings as comma separated values. Allow to embed
this information into the fwupd EFI binary at build time.

The SBAT metadata must contain at least two entries. One that defines the
SBAT version used and another one that defines the component generation.

Downstream users can add additional entries if have changes that make them
diverge from the upstream code and potentially add other vulnerabilities.

[0]: https://github.com/rhboot/shim/blob/sbat/SBAT.md
2021-02-10 16:40:59 +00:00
Richard Hughes
6188be1dd4 elantp: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
b1e4a23597 synaptics-rmi: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
2849116b33 uefi-capsule: Read the BMP in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
fb3b3e1841 vli: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
4a315856fa solokey: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
470251c439 wacom-raw: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
6607c41c6d wacom-usb: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
925f2e914b logitech-hidpp: Read from the device in a more safe way 2021-02-10 16:29:57 +00:00
Richard Hughes
4ae9aa87df csr: Be more safe when reading firmware from the device 2021-02-10 16:29:57 +00:00
Richard Hughes
d4dbb29a6e goodix-moc: Fix several places where the plugin code might crash
Fixes https://github.com/fwupd/fwupd/issues/2850
2021-02-10 16:29:21 +00:00
Richard Hughes
53de58f06d optionrom: Do not parse the image
The only real value of the optionrom plugin is the ability to store and verify
the ROM checksum; parsing the image is not actually required and is a source of
anxiety for various security teams.
2021-02-10 16:23:16 +00:00
Richard Hughes
a45d807a08 synaptics-rmi: Limit the number of containers to a sane value
Using hongfuzz we managed to build a valid firmware with 246625043 containers,
which took over 60 seconds to parse.
2021-02-10 15:27:42 +00:00
Richard Hughes
84176c9e1a synaptics-rmi: Be more careful when parsing invalid firmware 2021-02-10 15:27:42 +00:00
Richard Hughes
b0cf709f9b synaptics-rmi: Fix a memory leak when parsing invalid firmware 2021-02-10 15:27:42 +00:00
Richard Hughes
525f71f54b Merge the _udev_device() and _usb_device() vfuncs
There are now two 'backends' of device plug/unplug events, and there is about
to become three. Rather than just adding two more vfuncs for every backend type
define common ones that all providers can use.

Also fix up the existing in-tree plugins to use the new vfunc names and filter
on the correct GType.
2021-02-10 12:04:05 +00:00
Richard Hughes
2efa948b54 trivial: Add hailuck fuzzer to oss-fuzz 2021-02-09 16:37:25 +00:00
Richard Hughes
2e73bef923 Be more paranoid when parsing from ASCII buffers 2021-02-09 16:37:25 +00:00
Richard Hughes
67dda6b2e9 wacom-usb: Fix a buffer-overread spotted by AddressSanitizer 2021-02-09 13:05:46 +00:00
Richard Hughes
0cde61dd4d bcm57xx: Fix -Wcast-align issues spotted by clang 2021-02-08 13:26:27 +00:00
Richard Hughes
01a30aa6de Add support for oss-fuzz 2021-02-08 09:17:03 +00:00
Richard Hughes
3a30c1257c wacom-usb: Fix a crash detected by AddressSanitizer 2021-02-07 16:59:57 +00:00
Richard Hughes
8887b9128b uefi-capsule: Use an integer for EfivarNvramUsed
This is much easier to parse on the LVFS.

Fixes https://github.com/fwupd/fwupd/issues/2834
2021-02-06 14:23:09 +00:00
Richard Hughes
9b11af985f Add fu_memdup_safe()
See https://mail.gnome.org/archives/desktop-devel-list/2021-February/msg00000.html
for more details.
2021-02-04 21:01:00 +00:00
Javier Martinez Canillas
fde4b1676a uefi: Rewrite generate_binary.sh script in Python
The generate_binary.sh is a script that calls the objcopy tool and
genpeimg in the case of Windows, to generate a PE binary file.

But doesn't have to be a shell script and could be rewritten as a
python script. This will make this code to generate a PE binary
easier to extend if needed.

Also, the only reason that's a template is to define the objcopy
tool used, but this can also be passed as a positional argument.
2021-02-04 12:51:05 +00:00
Richard Hughes
f4a1592830 jabra: Ensure the protocol is set to avoid a daemon warning 2021-02-01 19:34:28 +00:00
Richard Hughes
f849a76766 trivial: Remove 'dfu-tool watch'
It's been broken for a long time, and nobody has noticed.
2021-02-01 19:34:28 +00:00
Richard Hughes
98972f4a34 libfwupdplugin: Promote DfuFirmware to FuDfuseFirmware
Port the DFU plugin to use the new objects to make it act the same as all the
other plugins.
2021-02-01 19:34:28 +00:00
Richard Hughes
ed4b8e28db dfu: Use FuChunk rather than defining DfuElement 2021-02-01 19:34:28 +00:00
Richard Hughes
7ccbd61f5d thunderbolt: Remove unused variable 2021-01-30 15:48:47 +00:00
Richard Hughes
6ceffbb585 system76-launch: Remove unused variable 2021-01-30 15:48:36 +00:00
Richard Hughes
27cb155dcf cros-ec: Make _do_xfer() outbuf const
The g_usb_device_bulk_transfer() function requires a mutable 'data' buffer, but
fwupd is sending file data and never wants the buffers modified.
2021-01-29 16:30:28 +00:00
Richard Hughes
9a241be490 trivial: Add fu_chunk_array_mutable_new()
This allows us to check that the plugin is writing into a mutable buffer. Also
fix up the plugins that are currently 'wrong' and use the new function for the
plugins doing the right thing.
2021-01-29 14:22:20 +00:00
Richard Hughes
d99f86023f trivial: Add getters to FuChunk
At the moment FuChunks are sometimes mutable, and sometimes immutable, and it's
all a bit too low level for comfort.

Before we can do any kind of optimisation or verification we need plugins to
stop reading directly from the C structure. The aim here is to make FuChunk
optionally mutable without making assumptions about the memory model, and also
to be able to introspect it for the docs.
2021-01-28 16:42:54 +00:00
Richard Hughes
382524d82f trivial: Fix potential crash when doing crazy things
Fix the asan crash when feeding the value back into itself, e.g

    fu_firmware_set_version (firmware, fu_firmware_get_version (firmware));
2021-01-28 14:13:59 +00:00
Richard Hughes
fed68479c0 dfu: Add support for GD32VF103 as found in the Longan Nano
This bootloader is *weird* -- the chip ID is the first two bytes of the serial
number and the data is offset and encoded in UTF-8, not UTF-16.

The sector information is also wrong. Gah!
2021-01-27 16:27:34 +00:00
Richard Hughes
5d7fb6ad88 uefi-capsule: Check if the fwupd BootXXXX entry exists on failure
Some systems remove the BootXXXX entry we add (so we can run fwupdx64.efi) and
thus the firmware update does not run. Most commonly this failure is seen with
Lenovo systems that call the helpful option 'Boot Order Lock'.

Hopefully when we depend on the new kernel bios interface sysfs API in we can
check in ->prepare(), not after reboot, but until that we can mark the update
failure as transient as the user can actually fix the problem themselves.

Fixes https://github.com/fwupd/fwupd/issues/2801
2021-01-27 14:49:57 +00:00
Richard Hughes
af75522a5e dfu: Show the DfuTargets when calling DfuDevice->to_string()
This is a much more standard way of doing this.
2021-01-27 09:18:44 +00:00
Jeremy Soller
fb3b349f16 system76-launch: Add a plugin for the System76 Launch Configurable Keyboard
This plugin supports reading the keyboard firmware version at runtime and
rebooting the keyboard to USB DFU mode. Tested with firmware uploaded to
embargo-system76.
2021-01-23 20:28:16 +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
8ca69364af dfu: Allow quirking the target transfer size 2021-01-21 09:18:38 +00:00
Richard Hughes
11603b3e06 Install the UX data into a single .tar.xz file
This allows much better compression (-60%) than gziping them individually and
also allows us to build the capsule UX images as part of the build stage.

Also add more popular screen resolutions for laptops you can buy in 2021.
2021-01-20 11:03:20 +00:00
Richard Hughes
6101067f03 coreboot: Remove plugin and instead add metadata to flashrom devices
The coreboot plugin never actually gained the ability to write. As it stands a
coreboot system now adds *two* system-firmware devices (from both flashrom and
coreboot) which isn't ideal.

Just allow flashrom to enumerate quirked devices and add coreboot-specific
metadata as required. If we require some kind of cbfs parsing then we can do
that in FuFlashromDevice->prepare_firmware().
2021-01-19 21:32:59 +00:00
Richard Hughes
0155ad6f9b Add the PCR0 to the report metadata
Although we could reconstruct the PCR0 value on the LVFS from the (already
included) event log, it's much more scalable if the client just provides the
data that we want to filter by.
2021-01-19 14:57:48 +00:00
Richard Hughes
a512d91d43 Report the lockdown status from UEFI and SuperIO plugins
I was asked the other day how many machines would support a /dev/mem mmap'd
update mechanism, and I had to say that I didn't know. We use direct port IO in
the SuperIO plugin too, and it would be good to know how quickly we need to
port this to something else.
2021-01-19 14:57:10 +00:00
Richard Hughes
8bafffa5f3 Read the kernel lockdown status at startup 2021-01-19 14:57:10 +00:00
Richard Hughes
9a81d63add pci-bcr: Only mark the device non-updatable if WPD unset and BLE set
It's unusual, but if BIOS lock enable is enabled (so we cannot *change* the
value of BIOSWE) but the BIOS is already WE then we can write to the hardware
just fine.
2021-01-19 14:44:51 +00:00
Richard Hughes
4a19138026 trivial: Use argparse for make-images.py 2021-01-19 11:56:55 +00:00
Richard Hughes
51f7bde2b7 trivial: Move the make-images script to the consumer 2021-01-19 11:56:55 +00:00
Richard Hughes
70ded56f8a synaptics-rmi: Add some support for PS2 devices
With much help from David Chiu <david.chiu@tw.synaptics.com>, many thanks.
2021-01-18 21:18:02 +00:00
Richard Hughes
a5deffb184 synaptics-rmi: Allow the device to enter a firmware mode that allows programming 2021-01-18 21:18:02 +00:00
Richard Hughes
1974adaa04 synaptics-rmi: Query the build ID and ProjectID to work around a HW bug
The build ID is set and the product ID is parsed in a different way for a PS/2 device.
2021-01-18 21:18:02 +00:00
Richard Hughes
8b1ca08332 synaptics-rmi: Write bus select zero when detaching
This has no effect for HID devices.
2021-01-18 21:18:02 +00:00
Richard Hughes
ff82d005d7 synaptics-rmi: Use the correct delay when erasing v5 firmware 2021-01-18 21:18:02 +00:00
Richard Hughes
a0dd0e2be2 synaptics-rmi: Split out the HID specific parts to FuSynapticsRmiDevice 2021-01-18 21:18:02 +00:00
Richard Hughes
edc0c08065 synaptics-rmi: Support parsing and writing signed firmware
Validate the firmware signature if provided
2021-01-18 21:18:02 +00:00
Richard Hughes
643d7b16b1 synaptics-rmi: Do not assign the class vfuncs during setup
We fixed this problem in logitech-hidpp and this plugin will suffer the same bug.
2021-01-18 21:18:02 +00:00
Richard Hughes
a2798213ee synaptics-rmi: Do not set the page to the existing value 2021-01-18 21:18:02 +00:00
Richard Hughes
2773476884 synaptics-rmi: Do not match all HIDRAW\VEN_06CB devices
Apparently, some devices will not respond well to probing.
2021-01-18 21:18:02 +00:00
Richard Hughes
a676a5ec70 Do not allow Lenovo hardware to install multiple capsules
Once a device has been scheduled for update mark the others from the same plugin
as updatable-hidden rather than updatable so that fwupdmgr or gnome-software
does not try to offer updates for them.
This is preferable to quitting with an error in FuDevice->prepare as we don't
want to waste bandwidth downloading the next update and then show the user an
error they can't possibly understand.

Exclude the currently scheduled device to allow the user to change the scheduled
release and so the pending device does not disappear from UI tools.
2021-01-15 21:43:45 +00:00
Richard Hughes
425ed311aa flashrom: Do not allow flashing if BLE is enabled
If BLE is set flashrom isn't going to work and the user would get a super scary
warning.
2021-01-15 15:24:19 +00:00
Richard Hughes
ae72b9b9f6 flashrom: Mark the device as requiring a reboot 2021-01-15 10:01:00 +00:00
Richard Hughes
568bb79ba0 flashrom: Spin the progress progressbar while flashrom is writing 2021-01-15 10:01:00 +00:00
Richard Hughes
e48fdff1c8 flashrom: Process the output of flashrom_flash_probe() correctly 2021-01-15 10:01:00 +00:00
Richard Hughes
5a53d0aeb0 flashrom: Do not show unhelpful debug output 2021-01-15 10:01:00 +00:00
Richard Hughes
99b7cf9c7f flashrom: Add a quirk entry for the Starlabs LabTop L4 2021-01-15 10:01:00 +00:00
Kees Cook
43f79d6c33 altos: Clarify ChaosKey name
While the firmware is altos, the product is better known as
"Altus-Metrum ChaosKey".
2021-01-15 07:08:20 +00:00
Richard Hughes
1a3d3b338e Make GUsb optional for fuzzing 2021-01-14 14:23:12 +00:00
Richard Hughes
eb4dcefbc6 Make the null-false-returns script also process return type
And fix up the rather disapointing single place we got it wrong...
2021-01-14 14:22:15 +00:00
Richard Hughes
dd0159dc00 trivial: Remove excess #include 2021-01-13 20:06:08 +00:00
Richard Hughes
a75ef53eaf trivial: Rename the meson option for plugin_synaptics_mst 2021-01-12 21:32:12 +00:00
Richard Hughes
5c915eef1e Check the return values of g_return_val_if_fail() in CI 2021-01-12 20:31:47 +00:00
Дамјан Георгиевски
bb8c8040c7 rename config section in uefi_capsule.conf to plugin name
in ee2e2c3674 the plugin name was changed
from uefi to uefi_capsule. while the config file name was changed, the
section name should also be changed.

fixes #2748
2021-01-12 17:53:26 +00:00
Richard Hughes
679a95f989 trivial: Remove unused bash script 2021-01-12 16:54:37 +00:00
Ilya Guterman
8fa65d98a5 stm-dfu: fix dnload wBlockNum wraparound 2021-01-11 16:50:50 +00:00
Richard Hughes
0d412b535e trivial: Remove invalid buffer dump in pixart_rf
Spotted by Coverity.
2021-01-08 20:53:11 +00: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
b63cfa90d6 Detect the AMD TSME encryption state for HSI 2021-01-06 16:45:33 +00:00
Richard Hughes
cf100293b5 Do not export useless device attributes to the client
That giant uint64_t isn't looking so big now, and we'll want to add even more
to it in the future. Split out some private flags that are never useful to the
client, although the #defines will have to remain until we break API again.
2021-01-06 14:36:23 +00:00
Richard Hughes
e002f21066 trivial: Prevent a crash when parsing corrupt RMI firmware
Using fu_common_bytes_new_offset() is much safer as it checks the source size.
2021-01-06 10:08:45 +00:00
Mario Limonciello
16fd5721c4 thunderbolt: add a unit test to make sure activation shows up 2021-01-06 09:11:00 +00:00
Mario Limonciello
5dc181181e thunderbolt: correct a logic error for DelayedActivation
This logic error wasn't being caught because the `DelayedActivation`
sysfs code wasn't running.

Basically the WD19TB device will have `skips-restart` applied by the quirk
by default.  After `fu_thunderbolt_device_setup_controller` has run
it will have `skips-restart` removed but `usable-during-update` applied
if on a new enough kernel.

In this circumstance the `DelayedActivation` would re-apply `skips-restart`
which is the wrong intended behavior per 834b28009d
2021-01-06 09:11:00 +00:00
Richard Hughes
104459bd10 Check the AMI test key if not installed for HSI-1
Fixes https://github.com/fwupd/fwupd/issues/2695
2021-01-05 17:09:02 +00:00
Richard Hughes
5c9e9f17c5 libfwupdplugin: Export FuEfiSignatureList for plugins to use 2021-01-05 16:42:58 +00:00
Richard Hughes
f47790bba3 ata: Add OUI quirk for Transcend
Fixes https://github.com/fwupd/fwupd/issues/2721
2021-01-05 16:20:09 +00:00
Richard Hughes
b2e97fb6b5 synaptics-cxaudio: Fix a critical warning when parsing invalid firmware 2021-01-05 15:59:30 +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
09f8a549c9 hailuck: Fix a critical warning when parsing invalid firmware 2021-01-05 15:59:30 +00:00
Richard Hughes
f68107e609 ccgx: 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
364e2685ca Do not show unprintable chars from invalid firmware in the logs 2021-01-05 15:15:07 +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
3252573ac7 synaptics-prometheus: Fix flashing a fingerprint reader that is in use
The fprint daemon only keeps the device open for 5 seconds and then releases it,
which seems like a small window to hit.

But! We're asking the user to authenticate with the same device we're about to
upgrade so a different part of the stack woke up the hardware just before we're
about to deploy an update onto it.

Just retry a few times to make sure the device is idle. Use a flag to prevent
accidentally causing regressions in other plugins.

Fixes https://github.com/fwupd/fwupd/issues/2650
2021-01-04 21:52:10 +00:00
Jimmy Yu
23cd466ef1 Add plugin to update PixArt RF devices
Signed-off-by: Richard Hughes <richard@hughsie.com>
2021-01-04 17:20:13 +00:00
Richard Hughes
64e9f6bd92 trivial: Fix up some NULL/FALSE confusion 2021-01-04 16:32:50 +00:00
Richard Hughes
f9fe19f7f6 Make libcurl optional for fuzzing
For fuzzing we want to exclude libcurl support as it depends on other very heavy
libraries like OpenSSL or libtasn which make the fuzzing binary much larger if
linked statically.
2021-01-04 16:22:36 +00:00
Richard Hughes
c2a0259fe6 Remove now-unused synaptics_rmi_dump fuzzing target generator
We can implement firmware->build and firmware->write and then use the shared
firmware.builder.xml functionality.
2021-01-04 15:42:17 +00:00
Richard Hughes
9f71fe3dc9 Make the 'id' for fu_plugin_add_firmware_gtype() optional
We can work out the correct value automatically in all cases but one, and it's
less for the plugin author to get wrong...
2021-01-04 15:27:10 +00:00
Richard Hughes
a2abc42760 libfwupdplugin: Use G_GNUC_WARN_UNUSED_RESULT for methods that should be checked 2021-01-04 15:24:35 +00:00
Richard Hughes
96ec0198e5 hailuck: trivial: Fix the GType name
The vendor is Hailuck as in one word, not Hai Luck.
2021-01-03 21:07:44 +00:00
RickyWu
9ce0922448 plugins: rts54hub: add Lenovo HotRod VID/PID
Signed-off-by: RickyWu <ricky_wu@realtek.com>
2020-12-31 09:18:46 +00:00
jingle.wu
6f8269fe0f elantp: Add new HWID for Lenovo X13 Gen 2. 2020-12-31 06:38:34 +00:00
Ricky Wu
f3510f56b2 plugins: rts54hid fix get report index error
fixed rts54hid get report index error

Signed-off-by: Ricky Wu <Ricky_wu@realtek.com>
2020-12-23 09:33:35 +00:00
Jingle Wu
fed9f56da8 elantp: Add new HWID for Lenovo X13 Yoga Gen 2. 2020-12-23 07:37:22 +00:00
Richard Hughes
3dc49c21b5 dfu: If no DNLOAD timeout is set assume a default value
This is probably a case where the device does not adhere to the specification.

Some hardware may be deliberately setting DNLOAD timeout to 0ms, and this patch
will make each request 5ms slower. This is probably a good tradeoff for having
most hardware 'just work' without a quirk entry.

Based on a patch by Zack Lee Yi Wei <zack_lee@chicony.com>, many thanks.
2020-12-21 13:11:14 +00:00
Richard Hughes
c32d14ebad dfu: Only wait for DFU_DNBUSY for 120 seconds 2020-12-21 13:11:14 +00:00
Richard Hughes
b8246a6cce dfu: Retry the GET_STATUS is DNLOAD_BUSY is returned
Perhaps fixes https://github.com/fwupd/fwupd/discussions/2687
2020-12-21 13:11:14 +00:00
Richard Hughes
e6dea87cb0 dfu: Use the standard debugging helpers 2020-12-15 09:36:41 +00:00
Richard Hughes
e3fb2e45cd trivial: Fix two more missing <string.h> instances 2020-12-14 20:24:04 +00:00