You are not logged in.

#1 2026-10-19 16:56:47

jwodder
Member
Registered: 2026-05-14
Posts: 22

[SOLVED] Modern approach to PCR 7 with fwupd

The Arch Wiki guide to encrypting a system with LUKS, TPM2, and Secure Boot currently contains a warning that updating firmware with fwupd or other methods can sometimes cause the value of PCR 7 to change, locking the user out of their system unless they have a recovery key.  However, a couple of months ago, fwupd gained a systemd-pcrlock plugin which apparently ensures that bindings to PCR 7 keep working; I'm just not clear on what exactly is required in order to make use of it.

Assume that I have fwupd installed and that I previously enrolled my LUKS volume in TPM2 using a binding to PCR 7 declared with --tpm2-pcrs (possibly among other bindings which shouldn't be relevant here).  Then:

  • The fwupd plugin README says the plugin is active if /var/lib/systemd/pcrlock.json exists (or if it contains a "generated policy"?).  I'm assuming systemd creates this file.  What do I need to do to ensure this file exists?  Do I need to enable some service?  Do I just run `systemd-pcrlock make-policy` once?

  • Do I need to re-enroll in TPM, this time using --tpm2-pcrlock=/var/lib/systemd/pcrlock.json instead of --tpm2-pcrs=7?

  • Is there anything else I need to do for firmware updates with fwupd to not mess with the TPM enrollment?

Last edited by jwodder (2026-11-04 18:01:51)

Offline

#2 2026-10-19 17:40:42

cryptearth
Member
Registered: 2024-02-03
Posts: 2,389

Re: [SOLVED] Modern approach to PCR 7 with fwupd

well, first of all: it depends on the exact type of tpm:
- is it dedicated chip on the motherboard or plugged into a header? that should be unaffected unless its own firmware is touched
- is it a firmware-tpm integrated into the cpu or bios? then this is touched everytime you update the bios (by any means)
but no matter which type of tpm you have: you should not rely on it only but always have some alternate backup way of still access the encrypted container

overall idea: a tpm isn't so much of a longterm secrets storage but rather something that checks whether the system is still within the same state as last time / when it was enrolled - so you rely on the system not get modified - with a bios update pretty is THE definition of modifying a system

if you regular update your bios go for something extern like a yubikey instead of a ftpm

Offline

#3 2026-11-04 18:01:37

jwodder
Member
Registered: 2026-05-14
Posts: 22

Re: [SOLVED] Modern approach to PCR 7 with fwupd

I ended up asking about this on Unix StackExchange, and the answer I got was:

  • The main prerequisite — generating the pcrlock.json file and ensuring it's kept up to date — is accomplished by running:

    sudo systemd-pcrlock lock-secureboot-policy
    sudo systemd-pcrlock make-policy
    sudo systemctl enable systemd-pcrlock-secureboot-policy.service
  • Yes, the systemd-cryptenroll command should then use --tpm2-pcrlock=/var/lib/systemd/pcrlock.json instead of --tpm2-pcrs=7.

Offline

#4 2026-11-04 18:23:51

topcat01
Member
Registered: 2019-09-17
Posts: 353

Re: [SOLVED] Modern approach to PCR 7 with fwupd

Interesting! Thank you for following up with a solution.

Offline

Board footer

Powered by FluxBB