Skip to content

soc: apple: sep: add sse, hibe and skdl endpoint clients - #1763

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
sepparity2/sse-skdl-hibe
Nov 13, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
sepparity2/sse-skdl-hibe

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Adds Linux clients for the three SEP endpoints that had none and have no Linux consumer: sse (Secure Enclave to Secure Element sharing), hibe (secure hibernation) and skdl (the CoreKDL kernel deny-list behind Apple Pay and FairPlay gating).

For all three the driver does what macOS does at boot: it checks that discovery names the endpoint with the one-page-each-way layout seen on M1 Pro, M2, M4 Pro and A18 Pro, reports it, and sends nothing.

  • sse (drivers/soc/apple/sse.rs): events the service announces (tag 2) are counted in diag/sse_events and not answered. Any other message is counted as unhandled. The call framing is typed and tested against our own J616s macOS 27 recording (request tag 1, length in the type/param bytes, "cESS" plus operation 1; reply tag 1, length 4, result 0, a protocol word). It is kept for a client that a Linux Secure Element stack would need. The query is not sent, because nothing shows it leaves the Secure Element and the sharing state untouched.
  • hibe (drivers/soc/apple/hibe.rs): Linux writes no hibernation image here. The fixed prepare-reply layout (wrapped image key, boot word, resume authorisation) is typed and tested for a future writer. Prepare is never sent as a probe.
  • skdl (drivers/soc/apple/skdl.rs): Linux has no receipt the enclave can verify and no protected service, so not even the version negotiation is sent. The offender list's 70-byte record layout and its length check are typed and fail closed.

New sysfs (documented in Documentation/ABI/testing/sysfs-driver-apple-sep): diag/sse, diag/hibe, diag/skdl (pending, then idle or absent) and diag/sse_events. aurora-sep status reports all three.

Tests:

  • KUnit: apple_sep_sse 6/6, apple_sep_hibe 3/3, apple_sep_skdl 2/2.
  • tools/aurora-sep/tests/test_aurora_sep_status.py passes, and so do the diag shim host tests.
  • J616s (M4 Pro), one-shot test kernel (this branch on integration 7945f4b): sse, hibe, skdl all idle, sse_events 0, unhandled messages 0, no new SEP log lines; Touch ID ready, key store open, hwrng live, SELinux enforcing, 0 failed units, 0 AVC; s2idle 3/3 with all three still idle and unhandled 0.
  • Neo (A18 Pro), same kernel: all three idle, sse_events 0, unhandled 0; Touch ID ready, key store open, hwrng live, enforcing, 0 failed units, 0 kernel errors, 0 AVC; s2r 1/1 (enclave woke) and s2idle 3/3 pass, with Wi-Fi, NVMe, display, input and USB unchanged after each wake.

🤖 Generated with Claude Code

Linux has no client for two of the SEP's twelve endpoints that are
reachable without a Secure Element stack or a hibernation writer: sse
(the Secure Enclave to Secure Element sharing service) and hibe (secure
hibernation).

sse: recorded on a J616s under macOS 27, the NFC daemon's first request
is a protocol query. The mailbox word has tag 1, the out-of-line length
(8) in its type and param bytes and zero data; the send buffer holds the
service signature "cESS" and operation 1. The enclave answers with tag
1, length 4 and result 0 in the data field; the receive buffer holds a
protocol word. Send that query once after the bring-up and nothing
else. Sharing, provisioning and authorisation requests need a Secure
Element and are not sent. The buffers are registered on the first call,
as macOS does. Events the enclave announces (tag 2) are counted in
diag/sse_events and otherwise ignored. diag/sse shows the outcome and
diag/sse_protocol the word.

hibe: macOS sends nothing on this endpoint at boot, at idle, at display
sleep or across system sleep; it is used only around a real
hibernation. Linux writes no hibernation image here, so do the same as
macOS at boot: check that discovery names the endpoint with the one-page
layout and report it in diag/hibe, sending nothing. The fixed layout of
the prepare reply (wrapped image key, boot word, resume authorisation)
is typed and tested for a future writer. A message on the endpoint is
counted as unhandled.

Both endpoints are used only when discovery names them with the layout
seen on M1 Pro, M2, M4 Pro and A18 Pro (one page each way). aurora-sep
status lists them as served when the kernel has the clients.

KUnit (apple_sep_sse, apple_sep_hibe) checks the request word and bytes
and the reply word and bytes against the recording, the length split
across type and param, refusals, malformed and late replies, events,
the discovery words and the prepare reply split.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Nothing shows that the sse protocol query leaves the Secure Element and
the sharing state untouched, and no Linux client needs its answer. Stop
sending it: like hibe, the driver now checks at bring-up that the
endpoint is named sse with the one-page layout, reports it, and sends
nothing. The service's events (tag 2) are still counted in
diag/sse_events and not answered; any other message, a reply included,
is counted as unhandled. The call framing from the macOS recording
stays typed and tested for a client a Linux Secure Element stack would
need. diag/sse_protocol goes away with the query.

Add the same for skdl, the CoreKDL kernel deny-list service (Apple Pay
and FairPlay gating). macOS negotiates its version and submits a signed
receipt of the loaded kernel extensions at boot; Linux has neither a
receipt the enclave can verify nor a protected service, so it sends
nothing, not even the version negotiation. The offender list's record
layout (70 bytes) and its length check are typed and fail closed for a
later client.

diag/sse, diag/hibe and diag/skdl read "pending", then "idle" or
"absent", through one helper. aurora-sep status reports all three.

KUnit: apple_sep_sse 6/6, apple_sep_hibe 3/3, apple_sep_skdl 2/2
(discovery words, framing, offender list arithmetic and overflow).

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide RyanTheTide changed the title soc: apple: sep: add sse and hibe endpoint clients soc: apple: sep: add sse, hibe and skdl endpoint clients Nov 13, 2026
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 13, 2026 13:24
@RyanTheTide
RyanTheTide merged commit 4277bdd into integration/aurora Nov 13, 2026
7 checks passed
@RyanTheTide
RyanTheTide deleted the sepparity2/sse-skdl-hibe branch November 13, 2026 13:24
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