Commit Graph

5517 Commits

Author SHA1 Message Date
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
2b850b96c2 trivial: post release version bump 2020-12-16 13:16:36 +00:00
Richard Hughes
32d36a0bf5 Release fwupd 1.5.4 2020-12-16 12:52:28 +00:00
Mario Limonciello
ed4e9123c6 trivial: libfwupdplugin: don't fail to set up bwrap if /lib64 doesn't exist
Fixes: #2690
2020-12-16 07:56:09 +00:00
Richard Hughes
9d20bf9212 Do not trust the Block.HintSystem boolean for ESP filtering
Instead use it for preferential selection. If there is none it's okay, but if
there are 3 pick the one with the flag.

Fixes https://github.com/fwupd/fwupd/issues/2676
2020-12-15 15:42:13 +00:00
Richard Hughes
f99dc76cfe trivial: Actually check if __get_cpuid_count exists before using cpuid.h 2020-12-15 12:21:32 +00:00
Richard Hughes
9619514508 trivial: One more <string.h> missing include 2020-12-15 10:02:59 +00:00
Richard Hughes
e6dea87cb0 dfu: Use the standard debugging helpers 2020-12-15 09:36:41 +00:00
Richard Hughes
93867eda8e Allow linking with the CXX linker
This is required by oss-fuzz, for non-obvious reasons!
2020-12-14 20:34:20 +00:00
Richard Hughes
e3fb2e45cd trivial: Fix two more missing <string.h> instances 2020-12-14 20:24:04 +00:00
Richard Hughes
4ab347ec78 trivial: Do not use g_file_load_bytes() in the self tests
This is not available in older GLib versions.
2020-12-14 20:24:01 +00:00
Mario Limonciello
a7d1530385 fu-util: Add a new --no-remote-check to ignore checking for download remotes
This fixes the overloaded `--no-metadata-check` that was previously
present from being used in multiple instances.
2020-12-14 12:52:38 -06:00
Mario Limonciello
89a2f190b6 trivial: fwupd-refresh: don't add --no-metadata-check
This is implied because the service is started non-interactively
by systemd.
2020-12-14 12:52:38 -06:00
Richard Hughes
c0d4c09a02 Lower libcurl requirement further still
This allows us to build on Ubuntu 16.04!
2020-12-14 16:50:30 +00:00
Richard Hughes
a14de30153 trivial: Require <string.h> for strlen() and memcpy() 2020-12-14 16:49:03 +00:00
Richard Hughes
3a0ee309d5 trivial: Fix build warning when compiling without systemd 2020-12-14 16:29:39 +00:00
Richard Hughes
db8533f743 trivial: Don't accidentally depend on GLib 2.54.3
None of these branches are important enough to provide fallbacks for.
2020-12-14 15:33:00 +00:00
Richard Hughes
68f565c441 Don't assume we have memfd_create() 2020-12-14 13:09:47 +00:00
Richard Hughes
83a2b56044 trivial: Fix compiling when using -Dtests=false 2020-12-14 11:34:43 +00:00
Richard Hughes
e5074cdbbb trivial: Fix compiling without GUdev 2020-12-14 11:34:43 +00:00
Richard Hughes
39e391e046 Fix compile warnings when using -Db_sanitize=undefined 2020-12-14 08:33:41 +00:00
Piotr Drąg
dc5c3fef29 Update POTFILES.in 2020-12-12 12:36:16 +00:00
Richard Hughes
72df114793 fmap: Do not assume FuFmapArea.name is NUL terminated 2020-12-11 14:33:50 +00:00
Richard Hughes
fdea9336a6 fmap: Make mixed-endian safe 2020-12-11 14:33:50 +00:00
Richard Hughes
8b99d4f2ec fmap: Use fu_memcpy_safe() to prevent buffer over-read 2020-12-11 14:33:50 +00:00
Richard Hughes
312c68842c dfu: Show a warning if we fail to release the interface
I'm not returning FALSE here as it might break plugins.
2020-12-11 14:33:04 +00:00
Richard Hughes
91e5957b05 trivial: Only define HF_ITER if available... 2020-12-11 09:45:48 +00:00
Richard Hughes
c4ca8e25d1 Use honggfuzz to fuzz firmware rather than AFL
This has better multi-core performance and can run in persistent mode -- which
allows us to construct a test harness of all the parsers (which takes time) and
then just reuse the process for lots of different data.
2020-12-11 09:37:42 +00:00
Richard Hughes
531b8b417f fmap: Fix a critical warning when the FmapArea has zero size 2020-12-10 20:43:54 +00:00
Richard Hughes
ef714053fe trivial: Don't crash when failing to detect the CPU 2020-12-10 20:43:54 +00:00
Richard Hughes
c7d870aa97 Allow using fwupdtool as non-root for firmware commands
Just avoid loading SMBIOS and re-generating remotes when all we want to use is
the firmware loader. It also speeds up the self tests somewhat too.
2020-12-10 20:43:54 +00:00
Mario Limonciello
a61cca9e3d thunderbolt: Add maple ridge firmware parsing support
These are expected to be flashed via UEFI capsules *not* Thunderbolt plugin
* Flashing via fwupd will require matching kernel work.
* They're left here only for parsing the binaries

```
FuThunderboltFirmwareUpdate:
Family:                 Maple Ridge
IsHost:                 true
IsNative:               true
DeviceId:               0x1136
VendorId:               0xd4
ModelId:                0xa58
FlashSize:              0x0
Generation:             0x4
Ports:                  0x2
HasPd:                  true
Section0:               0x4000
Section1:               0x4210
Section2:               0x4610
Section3:               0x22958
  FuFirmwareImage:
  Data:                 0x67000
```
2020-12-10 09:59:58 -06:00
Richard Hughes
3baea5c2cf solokey: Fix a possible critical warning for invalid firmware 2020-12-10 14:58:11 +00:00
Richard Hughes
bfabf5c81f synaptics-rmi: Do not add zero sized container images
This prevents a DoS when parsing corrupt firmware.
2020-12-10 14:58:11 +00:00
Richard Hughes
f3539621ee ihex: Do not dump binary out to the terminal for corrupt files 2020-12-10 14:58:11 +00:00
Richard Hughes
6271176c33 ccgx: Do not add zero sized DMC records
This prevents a DoS when parsing corrupt firmware.
2020-12-10 14:58:11 +00:00
Richard Hughes
0eb8b6a2a8 synaprom: Do not add zero sized images
This prevents a DoS when parsing corrupt firmware.
2020-12-10 14:58:11 +00:00
Richard Hughes
976b6afe63 trivial: Allow turning off the FMAP binary search when fuzzing
This speeds up the fuzzing task from 22ms to 33us.
2020-12-09 18:08:08 +00:00
Richard Hughes
4dcd167215 synaptics-prometheus: Allow creating test firmware from builder.xml
This means we don't need a standalone executable to build blobs.
2020-12-09 18:06:26 +00:00
Richard Hughes
84617b6699 fmap: Allow writing and reading the image base 2020-12-09 18:02:07 +00:00
Richard Hughes
5771756f85 fmap: Allow creating test firmware from builder.xml 2020-12-09 18:02:07 +00:00
Richard Hughes
a9060f671c fmap: Correctly check minimum firmware size 2020-12-09 18:02:07 +00:00
Richard Hughes
056dfff741 synaptics-rmi: Fix possible buffer over-read for corrupt firmware 2020-12-09 15:25:04 +00:00
Richard Hughes
05e3377d11 trivial: Add fu_common_bytes_new_offset()
This is a safer version of g_bytes_new_from_bytes() which returns a GError
if the offsets are invalid rather than emitting a critical warning.

This prevents a critical warning and potential crash when parsing invalid
bcm57xx firmware.
2020-12-08 20:54:25 +00:00
Richard Hughes
faf8a460f9 trivial: Split out the daemon src list 2020-12-08 20:53:59 +00:00
Richard Hughes
140b7cebdb trivial: Split out the daemon dep list 2020-12-08 20:53:59 +00:00
Richard Hughes
7115d6c6a6 Do not leak global cargs out of libfwupd
This gives us warnings if a specific binary redefines the domain.
2020-12-08 20:53:59 +00:00
Richard Hughes
386f2c1d39 uefi-dbx: Fix a trivial buffer over-read when fuzzing 2020-12-08 20:50:55 +00:00