Repository navigation
Conversation
2 of 4 tasks
tpmAwaitReady waits for the uevent that announces /dev/tpmrm0. When the TPM driver is built into the kernel, the device is created before booster starts listening for uevents, so the event never comes and every TPM2 unlock waits out the full 3 second timeout. Return right away when /dev/tpmrm0 already exists.
Before unsealing a signed TPM2 token bound to PCR 11, booster extends PCR 11 with "enter-initrd". That step opened the TPM without waiting for it; only the unseal waited. When the TPM driver is a module, the disk can appear before the module is loaded, so the extend fails with "stat /dev/tpmrm0: no such file or directory" and booster falls back to the passphrase prompt. Move the wait from the unseal to the start of systemd-tpm2 token handling, so it covers the extend, the PIN prompt and both unseal paths. If no TPM appears, fail the token there instead of asking for a PIN.
The Void Linux test kernel builds tpm_tis as a module and NVMe into the kernel. With the disk on NVMe, booster finds the LUKS device before the TPM exists, which is the case the previous commit fixes. The kernel the other tests use has the TPM driver built in, so it cannot hit this case.
pilotstew
force-pushed
the
pr/tpm-await-device
branch
from
October 26, 2026 21:22
520d0c6 to
6f0c294
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue #431
Before unsealing a signed TPM2 token bound to PCR 11, booster extends PCR 11 with "enter-initrd". That step opened /dev/tpmrm0 without waiting for it. When the TPM driver is a module and the disk driver is built in (NVMe on most distribution kernels), booster finds the disk before the TPM exists. The extend then fails with "stat /dev/tpmrm0: no such file or directory" and booster falls back to the passphrase prompt.
The same error was fixed for regular TPM2 tokens in 2022, by waiting up to 3 seconds for the tpmrm uevent at the start of the unseal. The PCR 11 extend was added later and runs before the unseal, so it never got that wait.
Changes:
Testing: