Repository navigation
soc: apple: sep: add sse, hibe and skdl endpoint clients - #1763
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 13, 2026 13:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andskdl(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 indiag/sse_eventsand 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, thenidleorabsent) anddiag/sse_events.aurora-sep statusreports all three.Tests:
apple_sep_sse6/6,apple_sep_hibe3/3,apple_sep_skdl2/2.tools/aurora-sep/tests/test_aurora_sep_status.pypasses, and so do the diag shim host tests.sse,hibe,skdlallidle,sse_events0, 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 stillidleand unhandled 0.idle,sse_events0, 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