Repository navigation
installer: harden DKMS Secure Boot signing identity - #89
Conversation
|
Thanks for the Secure Boot hardening. I completed two independent review passes and checked the findings with host tests and targeted probes. These are comments for the draft, not a formal approval or change request. Reviewed head: Medium — custom SL4A MOK overrides are not forwarded to DKMS
Consequently, with explicit overrides selecting pair A and framework defaults selecting pair B, the installer can validate/enroll A while DKMS signs with B. The nonempty signer-name check at Reproduction: with both SL4A override variables exported, the actual installer resolver selected a scratch Suggested direction: either make the overrides configure the identity DKMS actually uses, with explicit handling of the global effect, or reject an override that differs from that identity. Add a behavioral test with distinct A/B pairs; checking only that a signer string exists misses this case. Low — expose the recovery option in help
Checks and rejected candidates
LimitsNo real DKMS install, enrollment, reboot, module loading, kernel build or Surface hardware test was performed. No remote checks were reported at review time; local test results are not CI results. Source was left unchanged. |
|
Thanks — agreed on the A/B signing-identity issue. I took the fail-closed option rather than having this installer silently rewrite global DKMS configuration. Current head:
I added a behavioral resolver test using a temporary DKMS config tree:
The existing unsigned-module fail-closed check is unchanged. I also added CI on the updated head is still waiting for fork-workflow approval, so I’m not claiming a new green run yet. |
|
Thanks — on Two test-only issues remain: Medium: the new warning assertion does not match the real help
but The other prompt says Clean host, SANITIZE=1 and fully C-instrumented aggregates exit 2, before the new behavioral resolver checks run. Please fix the expected token/semantic assertion, not remove the useful warning. The help already documents rotation, backup and shared identity correctly. Low: the temporary DKMS path rewrite is applied twiceAt test lines 111–117, replacing the drop-in glob and then replacing the framework prefix rewrites the already-prefixed temporary path again. The result nests the fixture root twice rather than pointing at its intended Independent execution with a single root substitution verifies last-drop-in-wins against actual reference DKMS Both modules and explicit replay target compile against existing Debian 6.12.111 headers (BTF disabled); later tools/descriptor/hunt checks also passed when run separately. |
|
@Syax89 The two host-test follow-ups are corrected at Fork CI run 38925987371 is green for normal and sanitizer host gates and both kernel builds. No real MOK rotation, DKMS reinstall or reboot was performed; PR stays draft for exact installer/Secure Boot hardware acceptance and distro portability. |
|
Thanks again for the fixes. Here is the focused follow-up verification. Reviewed exact head The distro-default qualification now goes beyond latest-upstream/synthetic evidence. I downloaded and extracted, without installing:
Executing the exact installer resolver/validator and actual packaged DKMS
The packaged DKMS classifier returns the scalar string This establishes a remaining packaged-default identity-selection bug for the tested Noble/Zorin combination, not just an upstream portability hypothesis. With both distinct pairs present, the installer can validate a different identity from the one DKMS selects for signing. A load/enrollment failure is conditional on the actual machine's keys and enrollment state; none was induced or claimed. Complete explicit framework/drop-in overrides remain a passing control. Please either make the default resolver match the supported packaged DKMS behavior or qualify/refuse this unresolved default case before claiming the same identity universally. Also, manual recovery docs should use the resolved certificate rather than universally importing Scope limits: downloaded Noble release package and published Zorin base-files; no installed Zorin inventory, package installation, real signed module build, MOK enrollment, boot or module load. Zorin's examined Noble repositories expose no replacement dkms entry, and its official live-session list has no preinstalled dkms; this supports repository compatibility, not a claim that every Zorin machine uses this version. Jammy DKMS2.8.7 has a different signing interface and was only inspected, not qualified by the Noble harness. Custom signers, module-specific overrides, other versions/distros and full Secure Boot lifecycle remain separate acceptance work. |
Summary
Harden the installer/activation Secure Boot path so it validates and enrolls the same signing identity DKMS actually uses, instead of assuming every distribution signs with
/var/lib/dkms/mok.key+mok.pub.This is tooling-only. It does not change the touchscreen driver or either runtime profile.
Why
DKMS signing paths are distro/configuration dependent:
/var/lib/shim-signed/mok/MOK.priv/var/lib/shim-signed/mok/MOK.der/var/lib/dkms/mok.key/var/lib/dkms/mok.pub/etc/dkms/framework.confandframework.conf.d/*.confcan override both.The previous installer could validate/enroll one certificate and then let DKMS sign the modules with a different key. It also treated certificate existence as sufficient even if the private key was missing or mismatched.
Changes
mok_signing_key/mok_certificatefrom the active DKMS configuration;SL4A_MOK_KEY+SL4A_MOK_CERTonly when they exactly match the signing identity DKMS is configured to use;--rotate-mok, backing up existing material first;activate, not a hard-coded DKMS path;PKCS#11 signing keys are explicitly refused rather than pretending the installer can manage them.
Safety properties
The rotation path is deliberately opt-in because replacing the DKMS signing identity affects all DKMS modules, not just this driver.
Existing MOK material is backed up before deliberate replacement. A partial or mismatched pair is never silently accepted as usable.
Tests
Adds
tests/secure_boot_installer_source_test.pytomake -C tests test.The contract test pins:
bash -n tools/sl4a-touch.sh.Opened as draft so the maintainer can review the installer UX separately from driver PRs #87 and #88.
Project provenance
This installer hardening is not itself a Windows-protocol change, but it comes from the same hardware qualification campaign that followed the Windows reverse engineering. For context, the functional path being qualified was driven by:
The Secure Boot work exists to make that reverse-engineered driver path reproducible across reboot/DKMS lifecycle testing without confusing signing/enrollment failures for protocol failures.
Review follow-up
The review's pair-A/pair-B concern is fixed using the fail-closed option: the installer first resolves DKMS's actual configured
mok_signing_key/mok_certificate;SL4A_MOK_*values are accepted only if they name that same pair. A different installer-only pair is rejected with instructions to configure DKMS itself instead.The contract test now executes the real resolver in a temporary DKMS-config tree and checks three behavioral cases: configured pair B with no override, override pair A vs DKMS pair B (must fail), and an override that repeats pair B (accepted).
--rotate-mokis also in executable--helpwith the backup behavior and warning that changing the shared DKMS signing identity can affect every DKMS module on the system.