Repository navigation
Use a fixed-length certificate serial so sysupdate can't corrupt verity signatures - #928
Merged
Merged
Conversation
Updated the genkey target to include comments explaining the fixed-length serial for verity signatures and the use of OpenSSL for key generation.
Installer builds for 226b63dDo not use these installers for production systems. They are intended for testing purposes only. They will update to the latest PR build, which will break your install eventually.
|
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.
The Problem
sysupdate writes the new usr verity signature over the old one without clearing the rest of the partition. If the new signature is shorter, the end of the old one is left behind. The partition then no longer parses, and the system can't mount /usr. Falling back to the previous boot entry fails the same way, because every signature partition is parsed at boot.
This used to be harmless because repart padded the split signature artifact to the full partition size. Since systemd 259.6 (in resolute-updates as 259.9 since Oct 19), repart trims that padding (systemd/systemd@b54ef83414). Upstream treats the overwrite as a sysupdate bug (systemd/systemd#43567). They fixed it with
PartitionZeroFill=in 262.1, which isn't in the 259 we ship.Our signatures change length because just genkey creates a new certificate every build with a random serial. About 1 in 256 serials encode one byte shorter because they start with 8x 0 bits, which makes the signature 1718 bytes instead of 1722.
History
TL;DR
A series of changes has left us with Ubuntu Resolute carrying a sysupdate that breaks signed boots if the new key is ever shorter, so we need to make sure ours are always the same length by not letting the first bits be eight 0s.