Repository navigation
Conversation
|
Urgent for J700 on the Arch/Omarchy path packaged in current main. The preservation decision needs a stronger contract before it can be called a valid sealed copy. It currently checks only the incoming IMG4 label, a private regular destination file and its opening comb label. It does not validate DER lengths, compare the embedded calibration, bind the seal to this Mac or establish current firmware/trust-bundle provenance. Even an eight-byte malformed comb prefix is accepted. The PARTUUID/hash metadata binds the carved cache, not the installed combined record, and PARTUUID alone does not track a firmware update. Please preserve a candidate only with explicit trusted provenance/validation, and report stale or mismatched material clearly rather than silently declaring it sealed. Do not replace a rejected candidate with bare FSC2. Add malformed/truncated, changed-source, mismatched-calibration and wrong-device/current-bundle cases. The installer documentation at Fedora also packages this helper in RPM The software gates are queued through an ordinary buildslot. I will update this same comment with the exact build and test results. No hardware test was performed in this review. Keep this urgent, with the preservation/provenance checks fixed and tested before an affected Touch ID boot. No private factory records are needed in the PR or its tests. |
f530195 to
2aa81ec
Compare
|
Updated (2aa81ec). The keep decision now rests on checks that tie the installed record to this Mac, rather than on its opening label:
New cases: malformed and truncated, changed source, mismatched calibration, a seal without this calibration, and wrong device. They use synthetic records only and fail against the current script. Suite: 100/100. On J713 with real records, the sealed calibration was verified and kept, and the corrupted variants were each refused. Other packages: Fedora is aurora-silicon/fedora-aurora#28 (release 8; the test is |
|
HOLD on I reproduced these gaps using synthetic records against this exact helper:
Please make the keep path depend on an admitted, device-local provisioning record. A concrete implementation contract is:
A concrete readiness implementation is a root-private marker under Concrete control-flow change in The decision should be equivalent to: current = extract_current_source(admitted_isc) # not the PARTUUID-only cache
inputs = admit_current_device_handoff(live_identity, current_firmware)
expected = reseal(current, inputs.seal, inputs.current_trust)
validate(expected, current, inputs)
if installed == expected:
mark_biometric_ready()
else:
preserve_private_rollback(installed)
atomic_install(expected)Those names describe proposed interfaces, not functions already present in this repository. Any missing/stale admission must take the refresh-required path before this code runs. Simply raising an exception in this helper is insufficient because Add warm-cache source changes, manifest-only firmware changes, old bundle alongside current, wrong-device/missing-identity, opaque property bytes, malformed/duplicate DER properties, and valid replacement/failed replacement with byte-exact rollback tests. Keep all fixtures synthetic. The existing FSCl and sensorless paths need regression coverage too. Validation on this exact head: 100/100 source tests pass; eight additional synthetic cases reproduce the gaps above. These package/source gates do not clear the validity and freshness holds. No device test was performed in this review. Rerun affected gates on the corrected source and retain the owner's match-only runtime gate. No merge or contributor-branch change is part of this review. |
The enclave loads a standalone FSC2 calibration (J700, J713) only
resealed with the Mac's own factory records:
comb { fdrd: IMG4 { IM4P, [0] seal-<CHIP>-<ECID> }, secb: trust bundle }
prepare-sep-calibration cached the carved image by partition identity
and wrote it over that record at every start.
Every start now reads the factory cache read-only from the Hardware
volume of the iBoot System Container, and rebuilds the record from it.
The APFS reader is bounded: the newest checksummed checkpoint, the
object maps, the file-system tree and uncompressed regular files only.
The rebuild takes:
- the FSC2 calibration's IM4P;
- the one seal, which must name the running Mac's CHIP and ECID from
the boot's local policy manifest, carry its serial number, and list
the IM4P's SHA-384 as its FSC2 digest;
- the trust bundle whose named copy matches trustobject-current.
IM4M properties are walked as strict DER, with limits on size, depth
and element count.
The installed record is replaced only when it differs. The replacement
is written atomically with mode 0600 and read back, and the old bytes
are kept as private rollback evidence. When the records cannot be
admitted, the bare image is never installed, a wrong-device or
malformed record moves to private quarantine, and Touch ID stays
unready. An FSCl comb record is still installed as carved, checked as
the extractor checks it.
Readiness is a per-boot marker in /run/aurora-sep that names the
admitted digests. aurora-sep-ready.service and fprintd now also require
calibration-ready, which checks the installed bytes against the marker.
SEP trusted keys start either way. These are provenance and structure
checks; the enclave verifies the signatures.
2aa81ec to
0f70c83
Compare
|
Thanks for the counterexamples. All three PRs now have a new head, and the helper is identical in each. The body has the details; point by point:
|
|
Please hold off on re-reviewing this for now. I'll update it with test results later today, including the full boot on the J713 with fprintd starting through the new readiness gate. |
|
Test results for 0f70c83, as promised: J713 (M4 Air), real boot. The helper, readiness check and gates installed here are byte-identical to this head; only the packaged install paths differ. On a cold boot:
Gate. On this machine, transient units running the real |
|
Closing: Ryan cherry-picked this head into main as 1ac87cb (helper, calibration-ready and tests), and #49's |
prepare-sep-calibrationruns beforeaurora-sep.serviceat every start, to prepare the Touch ID calibration.The bug
On Macs whose calibration is a standalone FSC2 image (J700, J713), the enclave refuses the bare image (
LOAD_CALIBRATIONfails). It loads the calibration only resealed with the Mac's own factory records:The helper cached the carved bare image by partition identity, and every start wrote it over that sealed record.
The fix
Every start now rebuilds the sealed record from this Mac's factory cache, then installs it only if the installed bytes differ.
Source of truth. The helper reads
FactoryData/System/Library/Caches/com.apple.factorydataread-only from the Hardware volume of the iBoot System Container. The APFS reader in the helper is deliberately narrow:Every object it reads is checksummed. Anything else is refused, with bounds on block size, tree size and depth, file count and file size. On this J713 the whole read takes about 80 ms. There is no cache.
Admission. A record is rebuilt only when all of these hold:
seal-<CHIP>-<ECID>.MANPmust carry the device tree'sserial-numberasSrNm.FSC2-<sensor>record, an exactIMG4 { IM4P { FSC2, version, payload }, [0] IM4M }. The seal'sFSC2object must list the IM4P's SHA-384 as itsDGST.trustobject-<sha256>whose digest and bytes matchtrustobject-current. Withouttrustobject-current, the only named bundle is used, and it must match its own name. This follows aurora-installer'ssensor-root-key.md.DGST.Installation.
/var/lib/aurora-sep/rollback, the newest four). The rebuilt record is then written atomically with mode 0600, fsynced and read back.Refusal.
/var/lib/aurora-sep/quarantine), out of the firmware search path.Readiness.
/run/aurora-sep/calibration-ready, and it is written again only after a successful install. It names the target and the digests of the source, the IM4P, the seal, the trust bundle and the installed record.aurora-sep-ready.serviceand fprintd now also needaurora-sep-calibration-ready. That check re-reads the installed record without following links and compares its SHA-256 with the marker. A record changed later, or opened up to other users, is therefore not ready either.aurora-sep.servicestill starts for SEP trusted keys either way, so sensorless Macs are unaffected.FSCl Macs. When the factory cache has no FSC2 record, the carved FSCl
combrecord is installed as carved, as before. It now goes through the same replace-only-if-different, rollback and readiness path. It is checked only as far as the extractor checks it (no FSCl hardware here), and an FSCl record is never quarantined.Limits. These are provenance and structure checks. The enclave alone verifies the seal's signature chain and the sensor binding.
The same helper and gates ship in aurora-silicon/fedora-aurora#28 and aurora-silicon/nixos-aurora#27.
Testing
tests/test_sep_calibration.py): 35 tests, all on synthetic APFS images, manifests and records. They cover:aurora-sep-calibration-readypassed.pkgrelstays at this PR's 7, with hashes updated. The package also installs/usr/libexec/aurora-sep-calibration-ready.