Commit Graph

2149 Commits

Author SHA1 Message Date
Richard Hughes
c8d0afe33d logitech-hidpp: Use fu_device_set_battery_level() 2021-03-05 12:27:10 +00:00
Sean-StarLabs
2bd7b62ee9
Correct L3 GUID (#2979) 2021-03-05 11:49:29 +00:00
Richard Hughes
9024112549 ccgx: Allow ignoring CCGX firmware checksum failures
This much improves fuzzing performance.
2021-03-05 11:37:46 +00:00
JimmyYu
6d45136c25 pixart: Filter the wrong report ID 2021-03-05 12:19:33 +01:00
Richard Hughes
56af6f21e9 elantp: Write the firmware in a slightly safer way 2021-03-05 09:47:38 +00:00
Richard Hughes
dd5f6247bc trivial: Remove unused source file 2021-03-05 09:42:27 +00:00
Sean Rhodes
247f29ad47 Updated StarLabs guids 2021-03-04 17:56:43 +00:00
Richard Hughes
a6784611e4 superio: Ensure quirks are set on the new devices
Fixes a regression in 79a217a2a6
2021-03-03 18:15:16 +00:00
David Chiu
5abbb85e58 synaptics-rmi: Fix firmware update of pointing device on Lenovo ThinkPad Nano 2021-03-03 16:07:05 +00:00
Richard Hughes
2659ba596e elantp: Require a reboot for i2c recovery write
ChromeOS reboots the i2c adapter but it's probably safer to just reboot:
648c32ee9b/etphidiap/scripts/chromeos-etphidiap-touch-firmware-update-legacy.sh (198)
2021-03-03 15:56:18 +00:00
Richard Hughes
78a1b18a93 elantp: Verify the firmware signature before flashing 2021-03-03 15:56:18 +00:00
Richard Hughes
0772c46e9f elantp: Only call ->detach() when writing a firmware blob
The detach is actually destructive (!) and cannot be reattached unless actually
writing a new firmware image.
2021-03-03 15:56:18 +00:00
Richard Hughes
c9d6fecc5e pixart: Workaround a HIDIOCGFEATURE bug and/or regression
We're still in the process of hunting for the real cause.
2021-03-03 15:36:42 +00:00
Richard Hughes
bf3732f994 pixart: Use the bluetooth UUID to set the logical ID
This means you can have more than one device attached to the same controller.
2021-03-03 15:36:42 +00:00
Richard Hughes
88d9ace4a3 pixart: Include the missing ->to_string() parent class 2021-03-03 15:36:42 +00:00
Richard Hughes
5f4c651d03 ccgx: Align the CCGX DMC firmware to 64 byte chunks
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31608
2021-03-03 14:29:29 +00:00
Richard Hughes
6db5522eaf elantp: Fix a regression when recovering the device in i2c mode
This was broken in 6188be1dd4, again mea culpa.
2021-03-03 13:24:52 +00:00
Richard Hughes
9f250fb511 elantp: Fix a regression in the defined IAP start address
This was accidentally changed in ae3ad6771, mea culpa.
2021-03-03 12:41:59 +00:00
Richard Hughes
c81b755872 Be more strict for custom quirk keys
Rather than trying to guess typos, force each plugin to register the quirk
keys it supports, so we can show a sensible warning if required at startup on
the console.
2021-03-03 08:30:34 +00:00
Richard Hughes
7d132b728c Simplify the quirk file format
The best way of not getting something wrong is to not require it in the first
place...

All plugins now use DeviceInstanceId-style quirk matches and we can just drop
the prefix in all files. We were treating HwId=, Guid= and DeviceInstanceId= in
exactly the same way -- they're just converted to GUIDs when building the silo!
2021-03-03 08:30:34 +00:00
Richard Hughes
79a217a2a6 superio: Use DeviceInstanceIDs to merge chip quirk metadata
This means we can use the standard ->set_quirk_kv() vfunc rather than using
FuQuirks directly with a custom group.
2021-03-03 08:30:34 +00:00
Richard Hughes
54c683c009 dfu: Use DeviceInstanceIDs to merge AVR quirk metadata
This means we can use the standard ->set_quirk_kv() vfunc rather than using
FuQuirks directly with a custom group.
2021-03-03 08:30:34 +00:00
Richard Hughes
f878a7bcba synaptics-mst: Use DeviceInstanceIDs to merge quirk metadata
This means we can use the standard ->set_quirk_kv() vfunc rather than using
FuQuirks directly with a custom group. Also use a plugin prefix for quirk keys.
2021-03-03 08:30:34 +00:00
Richard Hughes
24232d1d63 pci-bcr: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Richard Hughes
2bae97c6c2 vli: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Richard Hughes
707331e90b synaptics-cxaudio: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Richard Hughes
98c592fe51 ccgx: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Mario Limonciello
2994338c63 trivial: thunderbolt: set the version for Titan Ridge devices in FW 2021-03-03 07:32:35 +00:00
Richard Hughes
d94286b9de Allow enabling plugins only matching a specific HwId
At the moment plugins are doing this a few different ways; either looping
through the HwIds manually (e.g. flashrom) or setting a custom flag that is
checked in fu_plugin_setup (e.g. uefi-recovery).

Define a standard 'Plugin' HwId quirk to simplify plugins.
2021-03-02 18:19:45 +00:00
Richard Hughes
05217338b3 uefi: Do not use fu_plugin_has_custom_flag() in _init()
This means we can defer loading the quirks until all the plugins have loaded.
2021-03-02 06:33:46 +00:00
Richard Hughes
bb87a45af3 logitech_hidpp: Wait a few ms for the hardware to settle after detach
I guess the hidraw stack is a bit faster than it was 5 years ago...
2021-03-01 17:05:01 +00:00
Richard Hughes
f6ee6043c5 dfu: Correctly erase STM32 devices when transfer size is less than sector size 2021-03-01 17:04:34 +00:00
Richard Hughes
f32e4c0666 dfu: Do not use a heuristic to set the device status
This breaks on all STM32 devices and should be unnecessary now.
2021-03-01 17:04:34 +00:00
Richard Hughes
aeba5f7f53 dfu: Fix writing to the GD32VF103 bootloader
Just set the alt_name rather than creating one giant sector and use the GD32
serial number for the sector map fixup.

See c2c8215061
2021-03-01 17:04:34 +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
Mario Limonciello
76f0bab630 thunderbolt: correct an assertion if kernel failed FW read
```
18:28:37:0526 FuFirmware           fu_firmware_parse_full: assertion 'fw != NULL' failed
```
2021-02-26 15:11:51 -06:00
Richard Hughes
b13e8dae36 superio: Simplify device setup using the parent_class 2021-02-26 18:46:51 +00:00
Richard Hughes
2a0766b523 dfu: Mark the GD32 sectors as erasable 2021-02-26 18:46:28 +00:00
Richard Hughes
416562f9af dfu: Do not show a critical error when flashing footer-less binary files 2021-02-26 18:46:28 +00:00
Richard Hughes
d271cebee5 trivial: Fix compile warning with newer libgusb versions 2021-02-26 16:44:31 +00:00
blueue
03ed377dc6
Add a function to access private member variable to let it be modified (#2947)
* Add a function to access private member variable to let it be modified in ps2 flow.
2021-02-26 07:57:08 +00:00
Jeremy Soller
9beb12ad97 system76-launch: Prompt for unlock keypress if reset command is blocked 2021-02-25 12:37:24 -06:00
Richard Hughes
2c0f115650 vli: Fix the quirk key name for the Lenovo HDMI with power 2021-02-25 15:47:25 +00:00
Mario Limonciello
ed918a4cec dell-dock: Remove non-passive update flow support
This is effectively a lot of dead code.

* The minimum requirements for this feature are EC 00.00.00.23 and Hub2 1.42.
* "A00" docks shipped with EC 01.00.00.00 and Hub2 1.47
2021-02-25 15:47:25 +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
ae3ad67710 elantp: Add support for writing the firmware image
This allows for fuzzing.
2021-02-25 14:17:37 +00:00
Mario Limonciello
41d874ba52 trivial: add linker script for armhf
fixes FTBFS in Debian:
https://buildd.debian.org/status/fetch.php?pkg=fwupd&arch=armhf&ver=1.5.7-1&stamp=1614100547&raw=0
2021-02-24 08:14:17 -06:00
Richard Hughes
8aebd44404 dfu: Modernize the coding style to match the other plugings
Use a Fu prefix for source objects and files and use @self.

No logic changes.
2021-02-24 10:36:45 +00:00
Richard Hughes
ed4ca92eb3 synaptics-rmi: Read the PDT by calling the correct setup function 2021-02-23 12:05:28 +00:00
Ricky Wu
44ee5def43
Test rts54hub rtd21xx (#2927)
* rts54hub: Optimized rtd21xx ISP flow
2021-02-23 08:34:09 +00:00
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