Commit Graph

8003 Commits

Author SHA1 Message Date
Richard Hughes
404ab8e3e9 trivial: Rename the internal NvmProductId to NvmModelId to match Intel docs
This preserves sanity when comparing numbers from vendors.
2022-09-13 14:25:15 +01:00
Mario Limonciello
561c8661f8 trivial: convert pci-psp plugin to create and use a device
In general this is a cleanup, means less vfuncs that get called when
devices are added. Beyon the optimization functionally should be a
no-op for fwupd.  It will also potentially storing the version
to the newly created secure processor device in the future.
2022-09-13 07:14:22 -05:00
Richard Hughes
bfebede490 Add support for platform capability descriptors so devices can set quirks
This feature adds support for platform capability BOS descriptors which allows
the device itself to ship quirk data.

Use `sudo fwupdtool get-devices --save-backends=FILENAME` to save fake backend
devices to a file. This allows easy creation of self tests that do not require
physical hardware.
2022-09-13 12:07:35 +01:00
Dylan Van Assche
a8017e0a4f mtd: expose Pine64 PinePhone Pro MTD as Tow-Boot
Pine64 PinePhone Pro has an SPI device which is handled by the MTD
plugin and comes with Tow-Boot pre-installed from the factory.
Expose it as Tow-Boot and mark the firmware type with uSWID for version
extraction. However, it does not provide uSWID data so users have to manually
upgrade to a Tow-Boot version with uSWID data support first.
2022-09-12 14:51:14 +01:00
Richard Hughes
d0edac7b67 trivial: Move to macos-12 for CI 2022-09-12 14:47:51 +01:00
Richard Hughes
84a27ea8b9 Fix a fuzzing crash when parsing malicious FDT data 2022-09-12 13:48:45 +01:00
Richard Hughes
e358cc7bde Set the firmware contents even when subclassing ->parse() 2022-09-10 09:16:05 +01:00
Richard Hughes
e8684d9f65 Check for plugin conflicts slightly quicker 2022-09-09 19:23:29 +01:00
Richard Hughes
ee57012df2 trivial: Work around a clang checker false-positive 2022-09-09 19:23:29 +01:00
Richard Hughes
1dab4f67cf modem-manager: Fix debug format string
PVS: The size_t type argument is expected.
2022-09-09 19:23:29 +01:00
Richard Hughes
e17f41b638 rts54hid: Fix possible unsafe memcpy()
PVS: A call of the 'memcpy' function will lead to underflow of the buffer.
2022-09-09 19:23:29 +01:00
Richard Hughes
d8c464889a logitech-hidpp: Fix possible unsafe memcpy()
PVS: A call of the 'memcpy' function will lead to underflow of the buffer.
2022-09-09 19:23:29 +01:00
Richard Hughes
c19d7d8b9f trivial: Workaround PVS false-positive 2022-09-09 19:23:29 +01:00
Richard Hughes
824f634244 dfu-csr: Fix uploading to devices
This was due to an overzealous sed script running in 90254a5152.

PVS: A call of the 'memcmp' function will lead to underflow of the buffer.
2022-09-09 19:23:29 +01:00
Richard Hughes
f7b4f43744 Fix checking for invalid depth requirements
PVS: It's possible that the 'device_tmp' should be checked here.
2022-09-09 19:23:29 +01:00
Richard Hughes
4b16f66948 trivial: Check for impossible NULL child before dereferencing
PVS
2022-09-09 19:23:29 +01:00
Richard Hughes
af3d1116f6 parade-lspcon: Remove trivial dead init
PVS: The 'write_data[0]' variable was assigned the same value.
2022-09-09 19:23:29 +01:00
Richard Hughes
e6e476a0e7 emmc: Use struct init to set mmc_ioc_cmd
PVS: The 'idata.write_flag' variable was assigned the same value.
2022-09-09 19:23:29 +01:00
Richard Hughes
67a0812b92 logitech-hidpp: Fix debug text when getting a HIDPP error message
PVS: Two or more case-branches perform the same actions.
2022-09-09 19:23:29 +01:00
Richard Hughes
01994a993a trivial: Fix impossible crash when the firmware search path is NULL
PVS: The 'contents' pointer was used unsafely after it was verified against nullptr.
2022-09-09 19:23:29 +01:00
Richard Hughes
6bb1b1c81f trivial: Fix a BIOS setting self test value
PVS: The 'ret' variable is assigned but is not used by the end of the function.
2022-09-09 19:23:29 +01:00
Richard Hughes
9ab03d586e Fix aligning up addresses greater than 4GB
PVS: The size of the bit mask is less than the size of the first operand.
2022-09-09 19:23:29 +01:00
Richard Hughes
aa71485cc5 trivial: Fix a few theoretical memory leaks that can't happen in reality
PVS: The function was exited without releasing the 'str' pointer.
2022-09-09 19:23:29 +01:00
Richard Hughes
e84e8b6927 redfish: Use the passed offset when parsing SMBIOS tables
PVS: Parameter 'offset' is always rewritten in function body before being used.
2022-09-09 19:23:29 +01:00
Richard Hughes
c3851c82c8 trivial: Remove duplicate line
PVS: Two identical blocks of text were found.
2022-09-09 19:23:29 +01:00
Richard Hughes
a74e383f8d synaptics-cxaudio: Use fu_strtobool() to parse TRUE and FALSE
PVS: Converting type 'guint64' to type 'gboolean' can lead to a loss of high-order bits.
2022-09-09 19:23:29 +01:00
Richard Hughes
f49d5ed10c trivial: Fix invalid printf() usage
PVS: The line being passed could contain format specification.
2022-09-09 19:23:29 +01:00
Richard Hughes
76138349e2 Fix a potential critical warning when parsing firmware
PVS: The 'filename' pointer was utilized before it was verified against nullptr.
2022-09-09 19:23:29 +01:00
Richard Hughes
890a48045e trivial: Remove a duplicate line
The conditional expressions of the 'if' statements situated alongside each other are identical.
2022-09-09 19:23:29 +01:00
Richard Hughes
5014c87a2a trivial: Remove a condition that can never be non-valid
PVS: A part of conditional expression is always true: priv->children->len > 0.
2022-09-09 19:23:29 +01:00
Richard Hughes
72f6cc5a0a redfish: Fix a condition that can never be false
PVS: A part of conditional expression is always true: path != NULL.
2022-09-09 19:23:29 +01:00
Richard Hughes
08a9f02912 Use the correct JSON type for fwupd_bios_setting_from_json()
PVS: Converting type 'gint64' to type 'gboolean' can lead to a loss of high-order bits.
2022-09-09 19:23:29 +01:00
Richard Hughes
d88e6b4a1e trivial: Relax the requirement that fu_firmware_set_bytes() can only be called once
PVS: Expression 'priv->bytes != NULL' is always false.
2022-09-09 19:23:29 +01:00
Richard Hughes
5e3a601da9 trivial: Remove a useless g_return_val_if_fail()
PVS: Expression 'sender != NULL' is always true.
2022-09-09 19:23:29 +01:00
Richard Hughes
6a5eda0a44 trivial: Use G_GSSIZE_FORMAT in more places 2022-09-09 19:23:29 +01:00
Richard Hughes
908c1d8c02 modem-manager: Do not print (null)
PVS: Incorrect format. A null pointer is used.
2022-09-09 19:23:29 +01:00
Richard Hughes
ab5683deb0 emmc: Do not print (null)
PVS: Incorrect format. A null pointer is used.
2022-09-09 19:23:29 +01:00
Richard Hughes
f79572891b cros-ec: Fix trivial format specifier
PVS: The size_t type argument is expected.
2022-09-09 19:23:29 +01:00
Richard Hughes
425f1a70c7 dell-dock: Remove trivial duplicate line 2022-09-09 19:23:29 +01:00
Richard Hughes
0c80952e30 synaptics-mst: Check the firmware payload size when updating cayenne
PVS: Parameter 'payload_len' is always rewritten in function body before being used.
2022-09-09 19:22:58 +01:00
Richard Hughes
07b368d6b1 vbe: Fix a crash when dumping firmware
PVS: The null pointer is passed into 'g_byte_array_append' function.
2022-09-09 18:50:56 +01:00
Dylan Van Assche
c62e7a6bab android-boot: fix segfault
Store strings during the lifetime of the plugin and free them
when destroyed.
2022-09-09 16:16:50 +01:00
Richard Hughes
5f554d1668 ccgx: Write all the metadata block as intended
PVS: It's odd that 'sizeof()' operator evaluates the size of a pointer to a
class, but not the size of the 'metadata' class object.
2022-09-09 06:42:51 -05:00
Richard Hughes
aaf1f21dd3 Limit the archive size to 25% of the RAM, or 4G
PVS: Expression is always false
2022-09-09 06:12:14 -05:00
Mario Limonciello
f5d51d80eb trivial: fix container generation 2022-09-08 23:18:22 -05:00
Richard Hughes
80608dcac9 Allow setting the FuFirmware size when building firmware 2022-09-08 08:55:51 -05:00
Mario Limonciello
684c663dee trivial: add goshen ridge nvm version parsing 2022-09-08 09:56:33 +01:00
Richard Hughes
5ebc3b6ad9 Move the generic Intel Goshen Ridge code out to a new plugin
The original code was written by Dell for the dell-dock plugin, but
it's exactly the same code and NVM format for Intel reference hardware.
2022-09-08 09:56:33 +01:00
Richard Hughes
fc3ac81978 Load coSWID metadata from a uSWID MTD block device
The coSWID is a child of the parent, and the parent container does not have a
version. Also fix a small memory leak when parsing container formats.

Fixes https://github.com/fwupd/fwupd/issues/4294
2022-09-07 16:02:27 +01:00
Richard Hughes
c43b981d63 Fix parsing uSWID uncompressed metadata
The magic offset is not required as we're working on a pre-offset GBytes.
2022-09-07 16:02:27 +01:00