Skip to content

soc: apple: sep: add blocking biometric application keys - #407

Closed
cameroncooper wants to merge 3 commits into
omacom:integration/aurorafrom
cameroncooper:sep/application-keys
Closed

cameroncooper wants to merge 3 commits into
omacom:integration/aurorafrom
cameroncooper:sep/application-keys

Conversation

@cameroncooper

@cameroncooper cameroncooper commented Nov 7, 2026 •

Copy link
Copy Markdown

Applications need SEP-owned keys with fresh biometric authorization for each
signature or item decryption. Add a root-only /dev/sep-keys interface for
P-256 key creation, SHA-256 digest signing and authenticated ECIES decryption.
The existing /dev/sep-bio ABI remains available for fingerprint services.

Applications store an opaque wrapped key and its public point. Native signing
keeps the private scalar in SEP; decryption returns application plaintext to the
caller. There is no password fallback: the driver's machine-held identity secret
is setup material, not fresh user authentication. Current keys accept any enrolled
finger, so enrollment changes can grant access to existing keys. Current-set
binding and private-key import are not implemented.

Request ownership

Private-key ioctls block interruptibly. Each open file owns its requests and
cancellation IDs; a worker owns copied inputs and the hardware lease until
cleanup finishes, even after cancellation or signal interruption. Idle BIO and
key files can coexist. Conflicting firmware operations return EBUSY before
submission. Existing BIO worker generations and suspend draining are retained.

Every private operation matches into a fresh kernel-owned credential and disposes
it before publishing success. Cleanup failure suppresses the result and disables
key operations until reboot. A result is consumed before copying to userspace,
outside state locks. Copy faults cannot enable redelivery; cancellation cannot
recall an already-claimed copy. The reference client uses one libc ioctl call
without implicit EINTR replay.

Three signed, signed-off commits separate wire/policy helpers, the driver/UAPI
with implementation-path tests, and the canonical Python client/documentation.
The exported <linux/apple-sep.h> contains the layouts and ownership contract;
tools/aurora-sep/keys/README.md describes broker responsibilities and limitations.
This replaces this draft's earlier experimental key start/poll interface.

Validation

  • Both code commits build with the packaged 7.2.11-15-1-ARCH configuration,
    exported symbols and recipe-qualified Rust/LLVM toolchain.
  • Four in-source wire/policy tests and all three registered host suites pass.
    The suites exercise actual credential-cleanup paths, owned requests, lease
    lifetime, cancellation, result-copy faults and wiping, client cleanup, and
    C/C++ UAPI consistency. No credential-disposal faults were injected on hardware.
  • On J293/T8103, native startup and key-device-first activation passed without
    first opening BIO. Disposable key creation, independently verified signing and
    exact disposable decryption passed.
  • Modified-tag rejection, concurrent cancellation, real signal interruption,
    worker drain and a fresh no-finger timeout returned no plaintext. Data-copy and
    response-descriptor faults consumed their results and rejected the same ID.
  • Signing with an idle BIO file and ordinary fprintd right-index matching passed.
  • Suspend/resume passed, including independently verified signing as the first
    operation after wake with fprintd and automatic BIO activation suppressed.

Scope

The test used an existing identity with provisioning disabled and its previously
selected xart_guard=0 policy. This changes no device tree, provisioning or xART
policy, and does not solve guarded M1 first setup or macOS coexistence. Cold
power-cycle and other hardware are not claimed.

The combined policy enables signing and decryption. A complete forbidden-operation
matrix for the signing-only policy remains unvalidated. A trusted broker must
enforce caller identity, item ownership, operation restrictions and WebAuthn
origin/RP rules. A fingerprint does not authenticate a transaction's display or
isolate Linux users sharing one SEP identity.

One tag-test request expired before a capture, and one ordinary matching request
ended without a frame; the tester may have missed those scan windows. Separately
requested scans passed. An initial fprintd no-match and a subsequent daemon claim
refusal were also observed; the daemon was restarted before the successful
matching check. These are recorded, not claimed as fixed by this series.

This continues the application-key work proposed in
aurora-silicon/linux#1004 on Omacom's current integration
tree, with the blocking ownership model now replacing the draft's polling model.

@cameroncooper
cameroncooper marked this pull request as draft November 7, 2026 21:34
Match native access-control serialization, including Boolean values and complete encoded-member ordering. Add biometric signing and combined signing/decryption policy builders, credential-bound image initialization and context disposal messages.

These are wire primitives only; existing callers keep their authorization flow. Source policy and capture-layout tests pass, and the SEP module builds with the matching kernel toolchain.

Signed-off-by: Cameron Cooper <c@meron.cc>
Expose application-owned P-256 creation, signing and ECIES decryption through /dev/sep-keys. Each file owns its request and cancellation IDs; the kernel keeps fresh authentication credentials private and disposes them before publishing success. Failed disposal suppresses results and disables the key API until reboot.

Use a shared capture lease to arbitrate biometric and key work. Preserve BIO worker generations and suspend handling, retain ownership through hardware cleanup, and serialize enqueue with removal. Claim successful results before user copies, wipe failed delivery, and prevent automatic syscall restarts after submission.

The matching module build, source credential-cleanup tests and six request/file/lease/delivery tests pass. Hardware regression is performed on the completed series.

Signed-off-by: Cameron Cooper <c@meron.cc>
Provide one importable blocking client with request-scoped cancellation and no automatic EINTR retries. Add disposable signing/decryption commands, the authenticated item envelope helper, C/C++ ABI assertions and client failure/ID tests.

Document device permissions, broker duties, delivery/cancellation errors and biometric-only policies. The machine-held identity-bag secret is not fresh password authentication; software passkeys and native SEP keys have different execution boundaries.

Signed-off-by: Cameron Cooper <c@meron.cc>
@cameroncooper cameroncooper changed the title soc: apple: sep: support biometric application keys soc: apple: sep: add blocking biometric application keys Nov 8, 2026
@cameroncooper

Copy link
Copy Markdown
Author

Closing: this work now continues against aurora-silicon/linux, where SEP development happens, as a smaller series built on the current driver:

These should reach this tree once its SEP driver is resynced with aurora-silicon.

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