Commit Graph

2489 Commits

Author SHA1 Message Date
Ricardo Cañuelo
e47de909c0 logitech-hidpp: adhere more closely to the specs
The restart message is supposed to be HIDPP_REPORT_ID_LONG according to
the specs, but it works just as well if we use
HIDPP_REPORT_ID_SHORT. We better stick to the specs, though.
2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
ab5c38b679 trivial: logitech-hidpp: fix request message setting 2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
297653f728 logitech-hidpp: remove user action message from Bolt receiver update 2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
c198055a54 logitech-hidpp: remove unnecessary 'bolt-peripheral' private flag 2021-09-20 10:21:44 +02:00
Richard Hughes
1ff96eb4b3 Restore the ABI for fu_device_detach() and provide new symbols
Quite a few plugins are using a FuDeviceLocker to detach then attach in
the error path, and finding them isn't easy as we explicitly cast to a
FuDeviceLockerFunc.

For sanity, just provide both symbols so we can do the right thing in
both cases. It seems like a sensible thing to allow.

Fixes https://github.com/fwupd/fwupd/issues/3771
2021-09-17 16:35:21 +01:00
Richard Hughes
3162c8540d Add new API for splitting an untrusted string
Using fu_common_strnsplit() has the drawback that a malicious user (or
a fuzzer!) could create a file with 5,000,000 newlines, and then pass
that into any parser that tokenizes into lines. This causes millions of
tiny allocations and quickly dirties hundreds of megabytes of RSS due
to heap overheads.

Rather than splitting a huge array and then processing each line, set
up a callback to process each line and only allocate the next string if
the token was parsed correctly. This means that we don't even dup the
buffer before we start parsing, rather than allocating everything and
then failing at the first hurdle.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38696
2021-09-17 14:46:45 +01:00
Richard Hughes
e50d911a59 logitech-hidpp: Use accurate FuProgress steps 2021-09-17 14:45:39 +01:00
Mario Limonciello
c0f242258b Fix probing the Dell TPM (Fixes: #3759)
Since commit 078beaf, device de-duplication between plugins doesn't
work anymore.  Both the TPM and Dell plugin create a device with an
identical physical ID and no logical ID.  This makes the device list
think whichever plugin probes second is just updating the first.

To avoid this problem, set a logical ID in the Dell plugin, ensuring
that the device ID built from physical + logical is different from the
TPM plugin.

The side effect of this is that both devices will export into the device
list, but the TPM plugin's devices will not be upgradable.
2021-09-16 13:52:44 -05:00
Mario Limonciello
ab65ea5db7 trivial: uefi-recovery: only run the plugin if efivar is available
This will cause it to disable on systems that are definitely not
relevant.
2021-09-16 06:44:27 -05:00
Mario Limonciello
35f62e1c84 trivial: msr: only run if /dev/cpu is present
I'm finding errors in a crostini container that the MSR plugin tries
to run and fails later.  The plugin just shouldn't be passing startup
if /dev/cpu isn't present.
2021-09-16 06:44:11 -05:00
Richard Hughes
c5dd4d4d4a pixart-rf: Use the correct method to add an instance ID
We actually check for fu_device_add_guid() not being an actual GUID,
but in the future we'll be warning if we do this magic fallback as it
hides not-quite-GUID typos.

No behaviour change.
2021-09-15 19:40:14 +01:00
Ricardo Cañuelo
26a1ddf49d logitech-hidpp: fix logical id for radio devices 2021-09-15 10:19:37 +02:00
Ricardo Cañuelo
5675e16274 logitech-hidpp: fix logical ids for BLE and paired devices 2021-09-15 10:19:37 +02:00
Simon Ho
5e67108ab8
plugins: add new plugin for Synaptics CAPE devices (#3746)
CAPE family is Audio DSP for a board range of applications in IOT, PC
and mobile can be interfaced via I2C, UART or USB interface. This patch
is only for CX31993 and CX31988 chips, there is not immediate plans is
to add support to other CAPE devices.

CX31993 have two separate firmware .hid file for for each partition. It
need to convert two .hid files into a .fw file for fwupd tool to
consume.

Currently, this patch is only support for EPOS headsets with basic
firmware update feature. Either new code singing or manifest.xml are
unsupported yet.

The code has been tested with CX31993 EVK board.

A test firmware file is put at 'src/fuzzing/firmware/synaptics-cape.fw'

synaptics-cape: Port to new FuProgress API and style fixups

synaptics-cape: Fix compile errors and add missing test fw file

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix fuzzer test

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix progress bar number

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Mark the fuzzing target

trivial: Use a stable GLib branch for fuzzing

synaptics-cape: Fix progress bar number

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix readme

synaptics-cape: Style fixups

synaptics-cape: Fix progress bar percentage

synaptics-cape: Style fixups
2021-09-15 03:42:07 +08:00
Richard Hughes
6817648c6b wacom-usb: Fix a false positive in real world firmware
Some files have a newline inbetween the AB sections.
2021-09-14 14:04:51 +01:00
Sean Rhodes
5d4e70e9cc
plugins/superio: Fix detection of IT5570 for StarBook Mk V (#3747) 2021-09-14 10:41:24 +01:00
Richard Hughes
d8d26e1f97 superio: Make the ports and timeouts specific to the DMI model
The chipset doesn't define the port like I guessed, as Tuxedo and Star
Labs both want to use a 0x5570 with different values.
2021-09-13 17:42:32 +01:00
Richard Hughes
9a2a4a211a synaptics-cxaudio: Use accurate FuProgress steps 2021-09-13 14:28:15 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Sean Rhodes
f959b198d2 plugins/flashrom: Fix logic in reset cmos
ioperm returns -1 for an error and 0 for success
2021-09-13 12:09:37 +01:00
Ricardo Cañuelo
15a39b94ee logitech-hidpp: Add support for updating Bolt peripheral firmware
Also simplify the Instance IDs added by the Bolt hardware.
2021-09-13 11:28:55 +01:00
Sean Rhodes
8cc158bda4 plugins/flashrom: Add reset-cmos flag to Star Labs laptops 2021-09-11 07:47:14 -05:00
Richard Hughes
8a9aea267c wacom-usb: Abort on invalid SREC files early to avoid a fuzzing timeout
Half a million new-lines was taking a long time to parse.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38381
2021-09-10 18:56:02 +01:00
Sean Rhodes
af9d9b3ffd plugins/flashrom: Add private flag to reset CMOS
Reset the CMOS based on a private flag. Tested on coreboot using an
offset of 123. Required when a CMOS layout or default option has
changed as the resulting flash will have 0's for the modified option.
2021-09-10 16:25:32 +01:00
Richard Hughes
b3824c94fa Fix a regression in flashing the Dell dock
This fixes a regression caused by 15b668c, we should have been more careful.

Fixes https://github.com/fwupd/fwupd/issues/3732
2021-09-10 15:50:52 +01:00
Richard Hughes
9e32b7325a trivial: Do not use deprecated GLib API 2021-09-10 15:02:46 +01:00
Sean Rhodes
bcf6253134 plguins/flashrom: Add GUID for StarBook coreboot 2021-09-09 22:31:56 +01:00
Sean Rhodes
33e850dea5 plugins/{superio,flashrom}: Add GUIDs for StarBook Mk V 2021-09-09 14:26:36 -05:00
Richard Hughes
3489b43700 wacom-usb: Also set the context for FuWacModuleTouch 2021-09-08 15:49:19 +01:00
Richard Hughes
0a81e22777 trivial: Set the context on FuWacModuleBluetooth 2021-09-08 12:08:33 +01:00
Richard Hughes
1210aa4ae7 redfish: Create user accounts automatically using IPMI
This allows the Redfish plugin to "just work" when there is no username
or password in the SMBIOS data. Using KCS we can create an admin account
from the host OS and then automatically enumerate devices.
2021-09-07 17:25:37 +01:00
Richard Hughes
fb3f869810 redfish: Refactor the PATCH modify code 2021-09-07 17:25:37 +01:00
Crag Wang
b81604f6c1 trivial: system firmware may primarily use sha256 bank instead sha1 2021-09-07 16:11:49 +08:00
Richard Hughes
cf34c8f1dd wacom-usb: Ignore invalid SREC commands to fail invalid files early 2021-09-05 15:46:00 +01:00
Richard Hughes
f56878ff88 Allow adding GUIDs to each HSI security attr
This indicates the GUID in some way contributed to the result decided.

It also allows us to match the submitted HSI results back to a firmware
stream on the LVFS, which allows us to allow vendors to see a subset of
results for uploaded devices.
2021-09-03 22:03:28 +01:00
Richard Hughes
11bcf2677c synaptics-mst: Only probe devices that have opted-in
Fixes https://github.com/fwupd/fwupd/issues/3701
2021-09-03 21:14:37 +01:00
Richard Hughes
d4fb04d6fc Allow overriding the quirks directory at runtime 2021-09-03 21:14:37 +01:00
Mario Limonciello
946cfd63ac trivial: synaptics-mst: make self tests not write
The self tests shouldn't be writing the source directory, make sure
they open up files in read-only mode.
2021-09-03 15:10:38 -05:00
Mario Limonciello
c62da839d5 trivial: platform-integrity: remove an unused variable 2021-09-03 15:10:38 -05:00
Mario Limonciello
0b7c0691e8 trivial: fix nvme and ata self tests failing in buildd
The buildds can't write to /var/cache/fwupd, and for that matter
fwupd shouldn't be writing during tests anyway.
2021-09-03 15:10:38 -05:00
Richard Hughes
504e8db1a0 uefi-capsule: Add the apply method to the uploaded report
We want to be able to differenciate failures for a specific update
method, e.g. finding if should be enabling CoD by default or not.
2021-09-03 13:11:17 -05:00
Sean Rhodes
2e856d21e0 plugins/flashrom: Only backup BIOS region
As we are only writing to the BIOS region, we only need to backup the BIOS
region. The will avoid the error "failed to back up original firmware" if
regions such as the ME can't be read.
2021-09-03 12:04:20 +01:00
Ilias Apalodimas
4eca8be63d uefi-capsule: Update documentation for CoD
Capsule update on-disk was added a while ago.
Document the config file changes and limitations on firmwares that's
doesn't support RT->SetVariable

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-09-02 17:54:34 +01:00
Richard Hughes
91536c5638 logitech-hidpp: Add the Model ID instance ID before getting firmware versions
This will allow us to create a device-radio child in the future.
2021-09-01 15:42:24 +01:00
Richard Hughes
0792ac0477 logitech-hidpp: Don't assume all USB devices with VEN_046D are Unifying
Logitech only provided one peripheral update for unifying hardware as a
PoC and now we are supporting other receivers this does not make a lot
of sense. All the new Bolt peripherals will need quirks anyway.
2021-09-01 15:42:24 +01:00
Richard Hughes
12f01c8622 logitech-hidpp: Use UNREACHABLE rather than modifying UPDATABLE 2021-09-01 15:42:24 +01:00
Mario Limonciello
92c8f0e727 trivial: fix the grub configuration from 684bc03
fixes #3685
2021-09-01 09:40:24 -05:00
Ricardo Cañuelo
512973fa50 logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00
Ricardo Cañuelo
35af30321a logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
Richard Hughes
9d2168e985 logitech-hidpp: Fix a regression in updating Unifying peripherals
This regressed in a3ecccc31c
2021-08-31 19:27:59 +01:00