Richard Hughes
60a4b56802
srec: Fix an overflow causing an infinite loop when parsing
2021-02-12 20:51:39 +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
293ccbf106
fmap: Fix self test failure on PPC64
2021-02-12 10:47:34 +00:00
Richard Hughes
c3ecec575b
fmap: Use memmem to find the FMAP signature
...
Trust glibc to optimize for the binary search, removing a oss-fuzz detected
crash with our bad pointer maths.
2021-02-11 20:27:20 +00:00
Richard Hughes
3ffc5baaad
trivial: Also fuzz the CRC checking routines
...
At the moment these sections are all red in the coverage report.
2021-02-11 20:27:20 +00:00
Richard Hughes
220ec716ca
trivial: Include firmware writing when fuzzing
2021-02-11 20:27:20 +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
fa840c1c9a
trivial: Do not reuse 'build' for the oss-fuzz build
...
This fixes a compile failure if ldflags are different between runs.
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
Richard Hughes
9bb5d279db
dfuse: Never add a DfuSe image with no defined chunks
2021-02-11 13:12:20 +00:00
Richard Hughes
7a23330158
dfu: Do not allow DfuSe chunk data to include the DFU footer area
...
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30813
2021-02-11 12:56:05 +00:00
Mario Limonciello
be220a4f56
trivial: fu-common: fix fallback for esp-path if udisks missing
...
Fixes : #2803
2021-02-10 11:58:37 -06: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
117f857899
Split the Udev and USB backends out of FuEngine
...
We get to say "hello" to Bluetooth devices soon...
2021-02-10 12:04:05 +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
9e9b73f303
Remove fu_plugin_get_usb_context()
...
It's unused, and only encourages plugins to do the wrong thing.
2021-02-10 12:04:05 +00:00
Richard Hughes
9303fedae0
trivial: Use json-glib from master to get a fuzzing crash fix
...
See 7711cbc7f8
2021-02-09 19:49:43 +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
9930998612
Integrate oss-fuzz with the CI
2021-02-09 16:37:25 +00:00
Richard Hughes
a84be50853
trivial: Do not invalidate timestamps for the Fedora package
2021-02-09 13:14:45 +00:00
Richard Hughes
67dda6b2e9
wacom-usb: Fix a buffer-overread spotted by AddressSanitizer
2021-02-09 13:05:46 +00:00
Richard Hughes
6920eb1214
ihex: Fix a buffer-overread spotted by AddressSanitizer
2021-02-09 13:05:32 +00:00
Richard Hughes
abdc82b1c1
dfuse: Fix a buffer-overread spotted by AddressSanitizer
2021-02-09 13:05:13 +00:00
Richard Hughes
c123bee369
trivial: Fix a buffer-overread spotted by AddressSanitizer
2021-02-09 13:05:09 +00:00
Richard Hughes
0cde61dd4d
bcm57xx: Fix -Wcast-align issues spotted by clang
2021-02-08 13:26:27 +00:00
Richard Hughes
0b6907e0bb
trivial: Fix warning from clang about unused variable
2021-02-08 12:53:32 +00:00
Richard Hughes
4d7bcaace5
trivial: Fix warning when compiling without libcurl
2021-02-08 12:53:12 +00:00
Richard Hughes
01a30aa6de
Add support for oss-fuzz
2021-02-08 09:17:03 +00:00
Mario Limonciello
b71b273c87
trivial: install_dell_bios_exe: fixup uefi-capsule -> uefi_capsule
...
Fixes : #2840
2021-02-07 23:49:27 -06:00
Mario Limonciello
5bbb0b7980
only copy files in hook if directory exists ( Fixes : #2619 )
2021-02-07 20:10:38 -06:00
Richard Hughes
3a30c1257c
wacom-usb: Fix a crash detected by AddressSanitizer
2021-02-07 16:59:57 +00:00
Richard Hughes
9b3f7aba82
trivial: Remove unused -Dlink_language support
2021-02-07 16:59:57 +00:00