Skip to content

Use a fixed-length certificate serial so sysupdate can't corrupt verity signatures - #928

Merged
lewisgoddard merged 1 commit into
mainfrom
fix/lewisgoddard/fixed-length-keys
Oct 23, 2026
Merged

lewisgoddard merged 1 commit into
mainfrom
fix/lewisgoddard/fixed-length-keys

Conversation

@lewisgoddard

@lewisgoddard lewisgoddard commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

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.

Updated the genkey target to include comments explaining the fixed-length serial for verity signatures and the use of OpenSSL for key generation.
@lewisgoddard
lewisgoddard requested a review from jumpyvi October 23, 2026 00:15

@jumpyvi jumpyvi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-actions

Copy link
Copy Markdown

Installer builds for 226b63d

Do 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.

Arch ISO Checksum
amd64 elementaryos-9.0-proposed-x86-64.20261023001449.iso sha256
arm64 elementaryos-9.0-proposed-arm64.20261023001501.iso sha256

@lewisgoddard
lewisgoddard merged commit 35c8b0b into main Oct 23, 2026
3 checks passed
@lewisgoddard
lewisgoddard deleted the fix/lewisgoddard/fixed-length-keys branch October 23, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants