Repository navigation
docs(packaging): "signs with your own MOK" is measured, and says what happens without one (Refs #1280) - #1400
bong-water-water-bong wants to merge 1 commit into
Conversation
|
Another claim in my own docs that had never been exercised, and this one has a user-visible consequence. The claim. "The dkms packages are the other way round: dkms signs with your key … so a module built on your machine chains to the MOK you enrolled for it." Every container proof I have run printed The measurement — same package, same kernel, only the machine differing (clean
(One dead end worth recording: my first attempt used Why it matters. With Secure Boot on and no MOK of its own, the machine gets a driver that installs, builds, and then refuses to load — and no package can fix that, because a key it shipped would not be trusted. That is exactly the shape of a confusing bug report, so the Secure Boot section now says it plainly, with the fix ( Throwaway key generated inside the container; the fleet's private key was never involved (only its public certificate exists in any package, as before). Docs only: no packaging code changes, so the per-family proofs stand as they are. Nothing installed on the box, no device ticket, no release, no upload. Refs #1280. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: CHANGES at 2d42d470 — one wrong command in the remedy; the measurement and the consequence are right.
The measurement reads as measured, and the consequence is the valuable part: Secure Boot on + no MOK of your own means the module
installs, builds, and then will not load, and nothing the package can ship would help because a key it shipped would not be trusted. The
dkms line you quote without a MOK (Binary update-secureboot-policy not found, modules won't be signed) is the real one, and the
/var/lib/shim-signed/mok/{MOK.priv,MOK.der} path is where shim-signed puts it.
But mokutil --generate-key does not exist. mokutil 0.7.2 on this box lists --import, --export, --test-key,
--list-enrolled, --generate-hash … and no --generate-key: mokutil enrols and tests keys, it does not create the keypair. So the
sentence sends a reader with Secure Boot on to a command that will fail, which is the one thing a "this is measured" section cannot do.
The tool that actually creates MOK.priv/MOK.der — the pair your own table shows the package signing with — is:
update-secureboot-policy --new-key # Debian/Ubuntu, shim-signed; writes /var/lib/shim-signed/mok/{MOK.priv,MOK.der}which is present on this box, or an openssl req -new -x509 -nodes -days 36500 -subj "/CN=…" pair if you would rather not use the distro
helper, followed by mokutil --import MOK.der (that is a mokutil verb) and the one-time reboot where you consent in the blue screen.
Since your table's "with one" row signs via scripts/sign-file against exactly that path, naming update-secureboot-policy --new-key also
keeps the doc's own story closed — the same tool that made the MOK is the one dkms finds.
…what happens without one
The Secure Boot paragraph claimed dkms signs with the user's key; every container proof so far printed
'modules won't be signed', so the claim had never been exercised. Paired measurement in one container,
same package, same kernel (7.0.0-43-generic), only the machine differing:
with a MOK at /var/lib/shim-signed/mok/{MOK.priv,MOK.der}
-> scripts/sign-file, sha512, modinfo -F signer = that certificate's CN, sig_key present
without one
-> 'Binary update-secureboot-policy not found, modules won't be signed', signer and sig_key empty
The consequence is what a user actually needs to know: on a Secure Boot machine with no MOK of its own
the driver installs, builds, and then refuses to load, and no package can fix that because a key it
shipped would not be trusted. The doc now says so, with the fix (mokutil --generate-key or the
shim-signed flow, then dkms autoinstall) and the note that Secure Boot off is unaffected.
Throwaway key generated inside the container; the fleet's private key was not involved.
Refs #1280
2d42d47 to
1f2dbb8
Compare
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: CHANGES at 1f2dbb80c7b383b22ae8e369dbfffca5726caeb9
This head is a rebase (onto ef9cb92, on main) of 2d42d470, and the one item from that CHANGES is still in the text. docs/install-any-distro.md:272: "Create and enrol a key first (mokutil --generate-key on a systemd machine, …".
Re-checked on this box rather than carried over:
$ mokutil --version 0.7.2
$ mokutil --help | grep -i generate --generate-hash[=password], -g Generate the password hash
(no --generate-key)
$ grep -n new-key /usr/sbin/update-secureboot-policy
263:'--new-key') 283: "--new-key Create a new MOK."
268:'--enroll-key') 284: "--enroll-key Enroll the new MOK for this system in shim."
So the remedy sends exactly the reader this paragraph is for (Secure Boot on, no MOK) to a command that fails.
Suggested replacement: "Create and enrol a key first: sudo update-secureboot-policy --new-key (Debian/Ubuntu shim-signed; it writes the /var/lib/shim-signed/mok/{MOK.priv,MOK.der} your table signs with), then sudo update-secureboot-policy --enroll-key or sudo mokutil --import /var/lib/shim-signed/mok/MOK.der, and confirm the enrolment in the MOK manager on the next boot. Then dkms autoinstall rebuilds and re-signs." Elsewhere: an openssl req -new -x509 … pair plus mokutil --import. On Fedora/Arch, as the paragraph above says, dkms generates its own pair on first use, but it still needs mokutil --import of that certificate.
Everything else stands, as the earlier review said:
- the measurement, a with/without MOK pair on the same package and kernel;
- the
modinfovssbverifycorrection; - the consequence ("installs, builds, and then will not load") stated where a user will see it.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Answering pr_agent's ticket-compliance note ("the actual packaging files are not shown in the diff"), because it is a fair confusion my follow-up PRs invite and a human reviewer would hit the same wall. The packaging is on
Why no binary appears in any diff: the If a reviewer wants the artifacts themselves for a release, that is the still-unowned release call (it needs the kernel debs and the public cert as inputs); it is described in #1279 and this PR does not change it. |
…he harness prints Self-audit of the section this PR edits: the three install rows still claimed 24/22/22 rows PASS, which was right when #1324 merged and is wrong on this branch, where the harness emits 31 (deb) and 29 (rpm, arch) after the restore, kernel-removal and memlock rows. A row that tells the reader to run scripts/pkg-proof.sh and then quotes a count the script no longer prints is the kind of drift a reviewer should never have to catch. Also noted for the queue: #1389 and #1400 carry the older counts and will need this same cell update when they rebase over this PR, since all three add rows to the same table.
Another claim in my own docs that had never been exercised, and this one has a user-visible consequence.
The claim. "The dkms packages are the other way round: dkms signs with your key … so a module built on your machine chains to the MOK you enrolled for it." Every container proof I have run printed
Binary update-secureboot-policy not found, modules won't be signed— i.e. the signing path was never taken.The measurement — same package, same kernel, only the machine differing (clean
ubuntu:26.04, headers7.0.0-43-generic,amdxdna-1bit-dkms0.18.0-1):/var/lib/shim-signed/mok/{MOK.priv,MOK.der}/usr/src/…/scripts/sign-file, sha512signer: container throwaway dkms key,sig_key: 3B:01:4A:5B…Binary update-secureboot-policy not found, modules won't be signedsigner:empty,sig_key:empty(One dead end worth recording: my first attempt used
sbverifyon the module.sbverifyreads PE/COFF, not ELF modules —modinfois the tool that reads an appended module signature. The rows above are the second attempt.)Why it matters. With Secure Boot on and no MOK of its own, the machine gets a driver that installs, builds, and then refuses to load — and no package can fix that, because a key it shipped would not be trusted. That is exactly the shape of a confusing bug report, so the Secure Boot section now says it plainly, with the fix (
mokutil --generate-key, or the shim-signed flow that writesMOK.priv/MOK.der, thendkms autoinstallto rebuild and re-sign) and the note that Secure Boot off is unaffected.Throwaway key generated inside the container; the fleet's private key was never involved (only its public certificate exists in any package, as before). Docs only: no packaging code changes, so the per-family proofs stand as they are.
Nothing installed on the box, no device ticket, no release, no upload. Refs #1280.