Repository navigation
apple: follow Aura's enforce policy in the default build - #78
Conversation
aura records what each boot stage checked in /chosen/aurora,boot-security of the devicetree it passes to U-Boot. When a stage enforced, aura's signature covers U-Boot, but the default build then still read the saved uboot.env from the ESP, kept the boot delay and the console, and booted through bootflow, booti or scripts with nothing checked. Only a U-Boot built with apple_secboot.config boots signed images, and its seed had to be built in at compile time. When the record shows an enforcing stage (policy "enforce" on the node or on a measurement, or state "verified"), the default build now: - uses the built-in environment: env_get_location() offers only ENV_IS_NOWHERE, so uboot.env is neither read nor written. Without an enforcing stage a FAT build behaves as before, and the nowhere location is not added as its fallback; - boots at once with no key check (bootdelay -2), ignores Ctrl-C and runs no preboot; - boots only EFI/BOOT/BOOTAA64.EFI from the internal ESP through bootefi under UEFI Secure Boot, and resets on failure or return; - refuses images that fail authentication even in an audit build: efi_init_secure_state() asks the new efi_aurora_enforce_policy() hook (weak, false) before it chooses CONFIG_EFI_AURORA_SECBOOT_AUDIT's audit state, and the Apple board answers from the record; - refuses to boot when its seed has no PK. apple_m1_defconfig enables EFI_SECURE_BOOT (with FIT and FIT_SIGNATURE, which it depends on), the audit mode, ENV_IS_NOWHERE and a preseed of board/apple/mac/uefi-seed.var: an empty variable seed in a fixed 16 KiB region ending in the marker AURORA-UEFI-SEED, its size and version, which aurora-secboot fills with the owner's keys before it signs Stage 2. Without keys Secure Boot stays off and the boot is unchanged; with keys and no enforcing stage it audits. EFI_AURORA_MEASURE records each image, as before. tools/apple_secboot_seed.py now writes the same region, so a seed built into an apple_secboot.config build can be refilled and checked the same way; tools/aurora_uefi_seed.py checks an image, and CI runs it on the apple_m1 build. lib/efi_loader/Makefile: the seed's dependency prefixed $(srctree) even to an absolute path, so the absolute seed path apple_secboot.config asks for could not build; a relative path now also builds with O=. doc/board/apple/m1.rst describes the policy. Signed-off-by: DjDeveloperr <[email protected]>
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Hardware row: M3 Pro (J516s, T6030), U-Boot built from this head ( Setup:
Notes:
|
|
Verdict at Blockers: none Checked
Evidence
|
|
6d29270 J413 (M2 Air, T8112, one-shot aura-try, default apple_m1_defconfig) PASS: non-enforcing boot ( |
What: The default Apple build follows Aura's enforce policy. When
/chosen/aurora,boot-securityshows an enforcing stage, U-Boot:uboot.env;EFI/BOOT/BOOTAA64.EFIfrom the internal ESP under UEFI Secure Boot, refusing rather than auditing, and resets otherwise.The keys come from a seed built into U-Boot.
apple_m1_defconfigships it empty, in a fixed 16 KiB region thataurora-secbootfills with the owner's keys before it signs Stage 2. Before this, only anapple_secboot.configbuild checked anything, so with the default U-Boot an enforcing Aura's chain ended at U-Boot. Without an enforcing stage the boot is unchanged.Tested: hardware row on the M3 Pro (J516s, T6030) with U-Boot built from
6d292702, using an enforcing Stage 2 and test keys: (a) a signed UKI boots, recordedverified; (b) an unsignedBOOTAA64.EFIis refused; (c) auboot.envis ignored under enforce, and runs without it; (e) a seed without keys is refused; (f) a non-enforcing boot is unchanged (#78 (comment)).apple_m1,apple_j873andapple_m1+apple_secboot.configbuild withWERROR;tools/aurora_uefi_seed.pychecks the seed region, and CI runs it onapple_m1.Risk: two-way · every Mac booting this U-Boot. Without an enforcing stage the seed has no PK: Secure Boot stays off, and
uboot.envand bootflow work as before.SecureBoot=0andSetupMode=1are now reported, where before Secure Boot support was absent.Not yet:
bootdelay=-2, Ctrl-C off, emptypreboot).250385f8) move to this branch in separate PRs after it merges, each with its own rows.Details
policyisenforce, or anymeasurement@Nhaspolicy = "enforce", orstateisverified.env_get_location()gives onlyENV_IS_NOWHERE(the built-in environment, nothing saved);saveenvstill createsuboot.env;apple_secboot.configbuild (nowhere only) keeps its nowhere location.bootcmdisrun aurora_secure_boot; reset, withbootdelay=-2, an emptyprebootanddisable_ctrlc(1).aurora_secure_bootloadsBOOTAA64.EFIandbootefis it with the control FDT.AURORA_UBOOT_SECURE_FAILand resets.apple_seed_has_pk(), a bounds-checked walk of the built-inefi_var_file), it only reports and resets.efi_init_secure_state()choosesCONFIG_EFI_AURORA_SECBOOT_AUDIT's audit state only when the new weakefi_aurora_enforce_policy()is false. The Apple board returns whether the record shows an enforcing stage, so the same image audits under an audit Aura and refuses under an enforcing one.ubootefi.varnever restores PK, KEK, db, dbx, dbt, dbr,AuditModeorDeployedMode(efi_var_restore(..., false)); with PRESEED they are also write-protected.efi_aurora_measure.crecords each image with its verdict.board/apple/mac/uefi-seed.var(.var, because*.binis ignored) is an emptyefi_var_file, zeros, and the 32-byte markerAURORA-UEFI-SEED+ size + version 1 at the end of 16384 bytes.tools/apple_secboot_seed.pynow writes that same region and refuses variables that don't fit.$(srctree)/even for an absolute path, so the absolute seed pathapple_secboot.configasks for failed with "No rule to make target". An absolute path is now used as-is, and-I$(srctree)lets a relative one build withO=.main. The shipped U-Boot comes fromaurora-wip, andmain's U-Boot resets before Linux on T6030.Evidence
apple_j873also builds withWERROR. The local builds turn offTOOLS_KWBIMAGE/TOOLS_LIBCRYPTO, because this host's OpenSSL 4.1 has no ENGINE API; that's unrelated and also fails without this change. CI uses Ubuntu's OpenSSL.