Commit Graph

69 Commits

Author SHA1 Message Date
Richard Hughes
0415db6f67 Revert "trivial: Use files() rather than current_source_dir()"
This reverts commit b581fa5670 as it breaks
`ninja dist` with `-Dgresource_quirks=enabled`.
2022-09-25 10:31:14 +01:00
Richard Hughes
b581fa5670 trivial: Use files() rather than current_source_dir() 2022-09-24 09:12:14 -05:00
Mario Limonciello
1f7526cce1 tpm: Don't require uefi capsule updates for checking TPM PCR0
There isn't any reason that we need to have a system advertising a
GUID with `main-system-firmware` in order to check that PCR0 reconstruction
matches what the TPM actually has.

Fixes: #4961
2022-08-29 07:56:23 +01:00
Mario Limonciello
2705179117 Convert HSI into a meson tristate-feature
This allows us to disable it automatically on architectures that
aren't supported and OSes that aren't supported.

Link: https://bugs.launchpad.net/ubuntu/+source/fwupd/+bug/1987067
2022-08-22 06:03:38 -05:00
Richard Hughes
77006b75eb Set the target value on the security attribute
Semantically it is the desire of the security attribute, not the bios
attribute, i.e. you could imagine that a specific attribute would have
to be *foo or bar or baz* for HSI-1 and *only foo* for HSI-2

Also make it easier to add possible BIOS attribute target values in
plugin code.
2022-08-01 07:12:18 +01:00
Mario Limonciello
9289e7d817 trivial: set firwmare attributes class directory for all tests
We don't want the system's firmware attributes class directory to
conflict.
2022-07-28 17:30:57 -05:00
Richard Hughes
829258401e Allow plugins and backends to print debugging information to the console
This is really useful for debugging.
2022-07-28 16:10:06 +01:00
Richard Hughes
a5749f4d23 Set the HSI levels in a central place
This means we don't need to worry about changing multiple
implementations if the HSI levels change for a specific ID.

It also means we can fake HSI results in the future without having
to also store the 'correct' level in the input file.
2022-07-15 20:21:22 +01:00
Richard Hughes
ae0c3fe38a Add 'action' resolution flags to each FwupdSecurityAttr
We tried to solve this by matching the org.fwupd.hsi AppStream ID, but
in some cases the resolution depends on what actually failed.

Add "the action the user is supposed to do" as flags so that the
front-end can translate this in the appropriate way, for instance,
using a different string for log events and HSI dialogs.
2022-07-14 14:47:44 +01:00
Richard Hughes
a61bb37881 Build the quirk files into the daemon as a GResource
Interestingly, this increases the `fwupd` binary size by ~30kb but
reduces the installed size of /usr/share/fwupd/quirks.d by ~330kb.
2022-06-30 18:52:24 +01:00
Richard Hughes
b8be6daf1f trivial: Use 'priv' for plugin private data to be consistent 2022-06-26 13:57:53 -05:00
Gaël PORTAY
299b42fe96 trivial: Make meson.build indentation consistent 2022-06-21 03:27:38 -04:00
Richard Hughes
faa7871b08 Remove duplicate ->probe() calls to speed up startup by 150ms
Now incorporate is fixed to copy across the properties we need in the
superclass, we don't need to do the subclass ->probe().

Note, we still need to do the subclassed ->probe() when using
FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT or when looking at properties
on the parent device.

This also removes the spurious 'already set GType to FuVliUsbhubDevice,
ignoring FuVliUsbhubDevice' messages when running the daemon.
2022-06-14 21:01:57 +01:00
Richard Hughes
fc2da47b69 Remove fu_strtoull_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
4105768a01 Remove the 'common' prefix when parsing version numbers 2022-06-14 14:36:52 -05:00
Richard Hughes
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
067d7d8088 Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
7f86ffab6f Split out the dump helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
ed1b13da28 Split out the memory helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
9d33c29e92 Split out the string helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
e6b487e762 Add FuProgress to ->startup() and ->coldplug()
This allows us to profile the daemon startup so we can find any plugins
taking an inordinate amount of time to start.
2022-06-04 20:21:50 +01:00
Richard Hughes
0b7af7d54b trivial: Ignore the return value of setenv() in most cases
This makes Coverity happy.
2022-04-13 15:08:12 +01:00
Richard Hughes
db07e84fe0 tpm: Fix a small memory leak in an error path 2022-04-13 15:08:12 +01:00
Kai Michaelis
0812ce5d20 tpm: Fix eventlog replay for Intel TXT machines 2022-03-23 21:18:46 +00:00
Richard Hughes
179dae4823 Do not throw away the TPM eventlog when uploading to the LVFS
To debug the eventlog reconstruction issues we need the raw blob,
rather than just the printable text.
2022-03-22 14:31:54 +00:00
Richard Hughes
c4ca026294 Allow devices to build instance IDs more easily
Provide a device instance builder that allows plugins to easily
create multiple instance IDs based on parent attributes.

Also fix a lot of the instance ID orders, so that we add more generic
IDs first, and more specific IDs after.
2022-03-03 09:13:29 +00:00
Mario Limonciello
661990ed98 Convert build system to use meson tristate features
tristate features will automatically disable if dependencies marked
as required are missing.

Packagers can manually override using `auto_features`.

Link: https://mesonbuild.com/Build-options.html#features
2022-02-28 08:34:48 -06:00
Mario Limonciello
66e3d99114 Don't show TSS2 error messages by default (Fixes: #4291) 2022-02-16 09:51:11 -06:00
Richard Hughes
cb9312744c tpm: Do not show a warning if the TPM eventlog does not exist
Fixes https://github.com/fwupd/fwupd/issues/4290
2022-02-16 14:50:18 +00:00
Richard Hughes
b5e7a0be16 Do not use gettext before calling setlocale 2022-02-09 16:56:47 +00:00
Richard Hughes
fd399da71b tpm: Fix a critical warning when loading an empty TPM eventlog item 2022-02-09 14:20:55 +00:00
Richard Hughes
d78ad32f24 trivial: Do not abort with a critical warning for a weird TPM event log
There is one eventlog item per-PCR with zero size.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2038167
2022-01-11 20:14:21 +00:00
Richard Hughes
7c4eb1bf92 trivial: Fix an impossible-to-hit scan-build warning 2022-01-03 22:46:23 +00:00
Richard Hughes
8fc8539146 trivial: Remove some unused variables 2021-12-10 16:00:07 +00:00
Richard Hughes
853b20ded4 tpm: Fix a tiny memory leak in the TPM self tests 2021-12-10 15:57:58 +00:00
Richard Hughes
eb4fa6dbf6 tpm: Fix a clang warning of a variable clash
Also, fix a memory leak as this is actually a `gchar **`.
2021-12-10 15:57:58 +00:00
Richard Hughes
dc1d5de057 Make the HSI tests optional for embedded targets
70% of the plugins installed on OpenBMC are not being used...
2021-11-29 09:30:57 +00:00
Richard Hughes
3e2e0aa616 trivial: Fix build error with old meson versions
On 0.58.1:

    ERROR: Bad source of type 'SharedModule' in target 'tpm-self-test'.
2021-11-19 06:54:46 +00:00
Gabriel Kerneis
3e8f09a0f7 Add HSI check that PCR registers 0-7 are not empty
Some BIOSes forget add measurements to PCR registers, which results in
all-zero checksums and breaks measured boot guarantees.

Fixes #3901
2021-11-17 16:21:52 +00:00
Richard Hughes
7e386f8791 trivial: Do not install the fwupdtpmevlog debugging cli to save 50Kb 2021-11-15 15:01:22 +00:00
Richard Hughes
c1f7ac47e8 tpm: Actually add the v1.2 device
Also, add end-to-end tests for this so it can never happen again.

Fixes https://github.com/fwupd/fwupd/issues/3972
2021-11-10 14:08:08 +00:00
Richard Hughes
e87fc05ab9 Speed up the daemon startup by ~2% by doing dlsym much less
We were calling g_module_symbol() 2703 times, which is actually more
expensive than you'd think.

It also means the plugins are actually what we tell people they are:
A set of vfuncs that get run. The reality before that they were dlsym'd
functions that get called at pretty random times.
2021-11-09 12:02:07 +00:00
Richard Hughes
510a9bfe0c Merge tpm-eventlog into the tpm plugin
This is so much less complicated.
2021-11-02 13:47:25 +00:00
Richard Hughes
e29c74180c Move the TPM handling into the TPM place
The fact that it currently lives in uefi-capsule is a historical
accident, and it doesn't really belong to tpm-eventlog either.

Fixes some of https://github.com/fwupd/fwupd/issues/3901
2021-11-01 14:51:27 +00: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
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Mario Limonciello
798d1ed3ee trivial: update markdown for pre-commit style 2021-07-18 14:42:47 -05:00
Richard Hughes
53538685fc trivial: Add FU_DEVICE_INSTANCE_FLAG_NO_QUIRKS to avoid quirk matches 2021-07-12 19:01:55 +01:00
Richard Hughes
dfaae2e837 Move amdgpu safety check into the plugin
There are now multiple plugins using drm_dp_aux_dev interface which
may potentially be combined with an amdgpu. Prevent exercising this
interface with any plugin using DP aux unless a new enough kernel is
installed.
2021-07-04 17:49:36 +01:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00