Skip to content

soc: apple: report the boot chain record - #1344

Merged
RyanTheTide merged 4 commits into
integration/aurorafrom
feat/aurora-boot-security
Nov 11, 2026
Merged

RyanTheTide merged 4 commits into
integration/aurorafrom
feat/aurora-boot-security

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds drivers/soc/apple/aurora-boot-security.c (APPLE_AURORA_BOOT_SECURITY, default y on Apple) and APPLE_AURORA_BOOT_SECURITY_LOCKDOWN (default y when the driver is built in).

aura (aurora-silicon/aura#133) and U-Boot (aurora-silicon/u-boot#43) write /chosen/aurora,boot-security: one measurement@N per item a stage handed over (stage, policy = enforce | audit | off, component, verdict, sha256, key-id, security-version), the chain state, iBoot's LocalPolicy facts (apple,lp-coih, apple,lp-smb0/1, ...), the Stage 1 build flavour (stage1-flavour = dev | secure) and U-Boot's Secure Boot mode (uefi-secure-boot = enforcing | audit | off). The driver:

  • logs aurora: boot chain <state>[, advisory] (<n> measurements, last stage <stage>/<policy>, stage1 <flavour>, uefi secure boot <mode>, lockdown from it: <reason|no>) at boot;
  • exposes /sys/firmware/aurora/boot_security/{state,advisory,policy,stage1_flavour,uefi_secure_boot,lockdown,lp_coih,measurements};
  • reports a verified record as partial unless an enforcing Stage 1 verified the next stage, and advisory = 1 in that case, since a stage nobody verified can write anything into the record;
  • measures the record into IMA as critical data (label aurora-boot-security, event boot-security-record).

Lockdown on the secure path (APPLE_AURORA_BOOT_SECURITY_LOCKDOWN): lockdown is raised to integrity when UEFI Secure Boot is enforcing (the SecureBoot variable, or U-Boot's uefi-secure-boot = "enforcing" in the record) or the record's chain is verified from an enforcing Stage 1 on, the equivalent of lockdown under UEFI Secure Boot on other platforms. Boots in audit or off mode are not locked down by it; lockdown= on the command line still applies. A forged record can only add lockdown. The lockdown LSM gains lockdown_from_firmware() for this.

No node, or a node without compatible = "aurora,boot-security-v1": no sysfs files; the Secure Boot lockdown check still runs.

Tests (QEMU virt, -cpu max, U-Boot qemu_arm64_defconfig + apple_secboot.config with test keys):

  • arm64 kernel with the driver built in, no lockdown= on the command line:
    • enforcing U-Boot, db-signed kernel: Kernel is locked down from UEFI Secure Boot, /sys/kernel/security/lockdown = [integrity], state partial, advisory 1, uefi_secure_boot enforcing, measurements = u-boot enforce efi-image verified <sha256>;
    • audit U-Boot, signed and unsigned kernel: boots, lockdown [none], uefi_secure_boot audit, verdict verified / bad-signature, state unverified;
    • enforcing U-Boot, unsigned kernel: refused, reset;
    • with ima_policy=critical_data the IMA log has the boot-security-record entry.
  • earlier: the driver as a module, signed with the build key, loads under a db-signed UKI with lockdown=integrity; the same module unsigned is refused.
  • module build with W=1 clean; checkpatch.pl clean.

Hardware (M2 MacBook Air, this driver on the 7.3.0 base it targets, Stage 2 and U-Boot as one-shot trials from aura#133 / u-boot#43, test keys):

  • Stage 2 without a record (current production): no sysfs files, no boot line, lockdown [none].
  • aura#133 default Stage 2 (signatures off, GRUB path): aurora: boot chain unverified, advisory (2 measurements, last stage stage2/off, ...); state unverified, advisory 1, lockdown no, stage1_flavour unknown; /sys/kernel/security/lockdown [none].
  • U-Boot enforcing UEFI Secure Boot, signed UKI (the Mac's kernel, initramfs and command line): Kernel is locked down from UEFI Secure Boot, /sys/kernel/security/lockdown [integrity], state partial, uefi_secure_boot enforcing, U-Boot entry verified with the UKI's sha256. The Mac boots to its desktop with 0 failed units, SELinux enforcing, no AVC denials; the only lockdown messages are hibernation and a /dev/mem open by a udev worker being refused.
  • U-Boot audit, signed UKI: lockdown [none], uefi_secure_boot audit.
  • Merged with integration/aurora (only conflict: drivers/soc/apple/Makefile).

🤖 Generated with Claude Code

RyanTheTide and others added 4 commits November 10, 2026 01:39
aura (Stage 1 and Stage 2) and U-Boot leave a record in
/chosen/aurora,boot-security: one measurement@N node per item a stage
handed over (stage, policy, component, verdict, sha256, key id,
security version), the chain state, and what iBoot reports about the
LocalPolicy that admitted Stage 1 (apple,lp-coih and related).

Log the chain state at boot and expose state, the per-stage policies,
lp_coih and the measurements in /sys/firmware/aurora/boot_security/.
The record is the firmware's account, not a proof, so a "verified"
record is reported as partial unless its first entry is an enforcing
Stage 1 that verified Stage 2.

Tested under QEMU (U-Boot with Secure Boot and the record, a signed UKI
of a 7.3.0-aurora kernel, lockdown=integrity): the module, signed with
the build key, loads and reports "aurora: boot chain partial (1
measurements, last stage u-boot/enforce)" with the U-Boot entry's
sha256 equal to the UKI's; the unsigned module is refused under
lockdown. checkpatch clean, W=1 clean.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…advisory

APPLE_AURORA_BOOT_SECURITY_LOCKDOWN (default y when the driver is
built in) raises lockdown to integrity when the boot is on the secure
path: UEFI Secure Boot enforcing (the SecureBoot variable, or U-Boot's
uefi-secure-boot entry in the record), or a chain the record calls
verified from an enforcing Stage 1 on. A boot in audit or off mode is
not locked down by it. A forged record can only add lockdown. The
lockdown LSM gains lockdown_from_firmware() for this.

The driver now also reports whether the record is advisory (no
enforcing Stage 1 verified the next stage), the Stage 1 flavour
(stage1-flavour: dev or secure) and U-Boot's Secure Boot mode
(enforcing, audit, off), and measures the record into IMA as critical
data (event boot-security-record).

QEMU (U-Boot qemu_arm64 with Secure Boot, test keys, arm64 kernel with
the driver built in, no lockdown= on the command line): enforcing
U-Boot + db-signed kernel boots locked down "from UEFI Secure Boot",
sysfs state partial, advisory 1, uefi_secure_boot enforcing; audit
U-Boot, signed or unsigned kernel, boots with lockdown none, verdict
verified / bad-signature; enforcing U-Boot refuses the unsigned
kernel. The record appears in the IMA log with ima_policy=critical_data.
Built as a module with W=1: clean. checkpatch clean.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rora-boot-security

# Conflicts:
#	drivers/soc/apple/Makefile
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 11, 2026 10:50
@RyanTheTide
RyanTheTide merged commit 9ada966 into integration/aurora Nov 11, 2026
4 checks passed
@RyanTheTide
RyanTheTide deleted the feat/aurora-boot-security branch November 11, 2026 10:50
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.

1 participant