We'd like to measure various additional things into PCRs, but all available ones to the OS are already used for various purposes. Hence, let's introduce a new concept of "NV Index based PCRs", i.e. let's use TPM2 nv indexes of type TPM2_NT_EXTEND that mostly behave like real PCRs, but which we can allocate relatively freely from the nv index space. Let's call these "fake" PCRs "NvPCRs". My original intention was to get a fixed NV index range assigned from the TCG, either for Linux or for systemd as a project, but this stalled with no further updates from the TCG for more than a year and a half now. I was told an NV index range to use though, even if it never was officially assigned, hence this PR uses this by default. But the range is configurable at build time, on purpose, so that downstreams have some flexibility to change this if they want. To abstract the actual nvindex number away we introduce a naming concept, so that nvindexes are referenced by name string rather than number. NvPCRs are defined in little JSON snippets in /usr/lib/nvpcr/*.nvpcr, that match up index number and name, as well as pick a hash algorithm. There's one complication: these nvindex (like any nvindex) can be deleted by anyone with access to the TPM, and then be recreated. This could be used to reset the NvPCRs to zero during runtime, which defeats the whole point of them. Our way out: we measure a secret as first thing after creation into the NvPCRs. (Or actually, we measure a per-NvPCR secret we derive from a system secret via an HMAC of the NvPCR name) and the nvindex handle). This "anchoring" secret is stored in /run/ + /var/lib/ + ESP/XBOOTLDR (the latter encrypted as credential, locked to the TPM), to make it available at the whole runtime of the OS.
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS
