fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

9.9K
active users

#sel4

0 posts0 participants0 posts today

On Apple Exclaves. Enhancing kernel isolation, one step at… | by Random Augustine | Feb, 2025 | Medium

Link


# 蘋果 Exclaves 系統安全機制解析

##
📌 Summary:
本文深入分析了蘋果在 2024 年導入的 Exclaves 安全機制,這是為瞭解決傳統單體核心作業系統的安全漏洞問題。蘋果透過將敏感資源與功能從 XNU 核心中隔離,建立了一個基於 seL4 微核心的「安全核心」(Secure Kernel),運行在與主系統隔離的「安全世界」(Secure World)中。這種設計能在主核心被入侵時仍保護關鍵資源,包括攝影機、麥克風指示燈、神經引擎功能等。Exclaves 代表了蘋果為增強 iOS、macOS 等系統安全所做的重大投資,提供了比其他終端裝置製造商更強大的安全防護機制。

##
🎯 Key Points:
- 現代作業系統通常採用單體核心設計,一旦發生漏洞可能導致整個系統被入侵,蘋果的 XNU 核心同樣面臨這個問題
- 蘋果自 2013 年起逐步建立安全隔離方案:先有安全隔離區(Secure Enclave),後有頁面保護層(PPL)和安全頁表監控(SPTM)
- 2024 年,蘋果在 M4 和 A18 處理器上推出 Exclaves,將敏感資源隔離到安全區域
- Exclaves 運行在名為「安全核心」(Secure Kernel)的微核心上,很可能基於 seL4 開發
- 系統通過建立「安全世界」(可能基於 ARM TrustZone 技術)來隔離 Exclaves,即使 XNU 被入侵也能保護敏感功能
- Exclaves 分為多種資源類型:共享記憶體緩衝區、音訊緩衝區、感測器、Conclaves(多資源分組)及服務
- 執行緒可以從不安全世界切換到安全世界執行代碼(Downcall),也能反向請求 XNU 服務(Upcall)
- 蘋果使用 Exclaves 保護攝影機/麥克風指示燈、Apple 神經引擎功能、與安全隔離區通訊的組件等

##
🔖 Keywords:
#Exclaves #安全核心 #ARM_TrustZone #單體核心安全 #seL4
Medium · On Apple Exclaves - Random Augustine - MediumBy Random Augustine
Continued thread

also found this for #sel4 #microkernel. i havent watched beyond the first lecture yet though, as i keep discovering so many more new concepts. i barely knew "object capabilites" (aka #ocap i think) before this. i thought pausing this and going back to the other series would be worth it.
youtube.com/playlist?list=PLto

Running the manual: an approach to high-assurance microkernel development
> the kernel is obviously a state
transformer, and hence, conveniently represented as a monad. This
choice is reaffirmed by the need for recoverable exceptions, which
are detailed in the next subsection. In fact, we will see that we want
to distinguish between code that may raise recoverable exceptions
and code that does not have that liberty. Hence, it is worthwhile
to use monad transformers as provided by the MTL in the Haskell
Hierarchical Libraries
> seL4 API includes several system calls that
attempt to manipulate a capability address space, which is a data
structure containing a sparse mapping from addresses to capabili-
ties. If one of these system calls fails to locate a specified capability,
it will generate a system call error that is returned to the caller. On
the other hand, a similar failure while searching for a capability that
is being directly invoked will generate a fault message that is sent
to the current thread’s fault handler; a failure while trying to trans-
mit a capability through a one-way communication channel will be
silently ignored when the receiver is unable or unwilling to receive
the capability.
> HOL is a logic of total functions and is as such not suitable to ex-
press the semantics of Haskell directly. It is however suitable to
describe the semantics of Haskell functions that always terminate
and that do not make essential use of laziness. The seL4 implemen-
tation consists of such functions.

#haskell #isabelle #sel4
portal.acm.org/citation.cfm?id

ACM ConferencesRunning the manual | Proceedings of the 2006 ACM SIGPLAN workshop on Haskell

if you port #seL4 to a new architecture, you’ll end up with a portion of code that has undergone formal verification in a different context, and a portion that is new and has not undergone formal verification yet. If the new architecture is similar to existing architectures, that new code is probably following patterns similar to the ones used in verified code.

None of that constitutes a new proof or gives any guarantees, but compared to an implementation that is entirely new code and has only undergone normal testing, there are still some benefits. The verified generic code can still fail in a new context, when it is used in ways that doesn’t satisfy its preconditions
sel4.discourse.group/t/is-ther

seL4 · Is there any value to porting seL4 to a platform without also verifying the port?There are bunch of aspects to this question, and some have been answered already, esp small trusted computing based, capability model etc. I’ll focus on the verification side only. tl;dr: there is a benefit, you’ll get lower defect density, it’s just not as strong as full verification. If you port seL4 to a new architecture, you’ll end up with a portion of code that has undergone formal verification in a different context, and a portion that is new and has not undergone formal verification yet...

Each of #seL4 ’s verified configurations target a single hardware/platform configuration. This specificity drasticially simplifies the proofs and also allows them to refer to a more accurate model of the platform/hardware.

The tradeoff is that changes to the hardware/platform configuration also require changes to the proofs and, because of correspondence requirements, also to the C source implementation of the kernel. As the kernel ABI is described by the C implementation of the kernel, the ABI can only target a single hardware/platform configuration at a time. There is tooling to make it easier to switch hardware/platform configurations across different kernel configurations, but this must all happen before the kernel is compiled; this is why there are lots of C preprocessor macros used in all the definitions.

This isn’t something that is impossible to change, but would require a very large investment into the verification to support it.
sel4.discourse.group/t/pre-rfc

seL4 · Pre-RFC: Specify a fixed kernel ABI for each architectureSo an idea that came to mind is: libseL4 is the only stable entry point for calling into seL4. Its API and ABI will be backwards-compatible. libseL4 is built as part of the kernel build process, and ideally will be formally verified at some point. There are two cases where the API and ABI may change in a backwards-incompatible way: If the major version number of seL4 is bumped, compatibility of the libseL4 API and ABI is not guaranteed. Such bumps are expected to be very rare (~once per...

@riskybusiness RE your discussion about viewing iPhone on macOS - I’m 99% sure this is a direct device to device connection, iCloud isn’t involved other than the devices being on the same account and having shared secrets/keys.

It’s not that different from the current implementation that lets you use an iPad as a second screen over wifi - it’s designed for the “my phone is in my pocket/over there charging and I don’t want to get it” use case, not the “my phone is at home and I want to stream its screen over the internet” case - unless I’ve missed something? I’d be shocked if it weren’t encrypted using keys in each device’s Secure Enclave.

Somewhat unrelated, but this also reminds me of some tech DST Group showed me years ago when we were teaching them. It allowed a user to use an untrusted web browser/computer to connect to a Remote Desktop-esque page, but the image was encrypted They had a device which sat between the computer and monitor which decrypted the image signal, and encrypted keyboard/mouse data back to the page. (All built on #seL4 of course).

In the first of our schedule highlights, we're delighted to present Scientia Professor @gernot who will present on efforts to take from a to fully-fledged
with , named for open source luminary, John Lions.

Schedule will be posted soon, we promise!

Heavily discounted tickets still available, for a short time only:
2024.everythingopen.au/news/re

Interestingly, #seL4 would be a worse choice that #Xen for #QubesOS, due to its worse support for x86 speculative execution mitigations. Xen typically provides patches the day the embargo breaks, and Qubes OS users rely on that. There are various ways to make speculative execution less of a concern, but they don’t work for Qubes OS. This is because Qubes OS heavily overcommits CPU and allows execution of arbitrary untrusted code in VMs.

I don’t fault the seL4 developers for not focusing on a use-case that is practically the worst-case scenario for it. It just means that Qubes OS is very much more like a server than an embedded system, and so it needs a hypervisor that is designed for the kinds of workloads it runs.

Continued thread

My comments were a reaction to totally unscientific comparisons of OS verification cost in two out of two papers in the first session: Comparing lines-of-proof vs lines-of-code (or person years vs lines-of-code), ignoring:
* highly-optimised real-world kernel (aka #seL4) vs academic toy
* verifying a full kernel (requiring proving many global invariants) vs verifying individual functions
* verifying code that deals with real hardware vs code that doesn't touch hardware

Sorry, but that's not even apples-vs-oranges. It's more like apples vs potatoes