arXiv:2610.35999cs.OSOct 2026

Manuscript Offprint

arXiv:2610.35999

safeL4: Rethinking Safe-Language-Based Single Address Space Microkernels

Zheyuan Xu, Xiaobei Zhang, Zihan Li, Zekai Nie, Guangtao Zhu, Zhuang Lu, Qianying Zhang, Shijun Zhao, Haibo Chen, Rui Hou

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Zheyuan Xu

Key Laboratory of Cyberspace

Security Defense

Institute of Information Engineering,

Chinese Academy of Sciences

Beijing, China

School of Cyberspace Security

University of Chinese Academy of

Sciences

Beijing, China

xuzheyuan@iie.ac.cn

Zekai Nie

Key Laboratory of Cyberspace

Security Defense

Institute of Information Engineering,

Chinese Academy of Sciences

Beijing, China

niezekai@iie.ac.cn

Qianying Zhang

Capital Normal University

Beijing, China

qyzhang@cnu.edu.cn

Xiaobei Zhang

Key Laboratory of Cyberspace

Security Defense

Institute of Information Engineering,

Chinese Academy of Sciences

Beijing, China

zhangxiaobei@iie.ac.cn

Zihan Li

Key Laboratory of Cyberspace

Security Defense

Institute of Information Engineering,

Chinese Academy of Sciences

Beijing, China

zihanli0822@gmail.com

Guangtao Zhu

UNSW Sydney

Sydney, NSW, Australia

guangtao.zhu@student.unsw.edu.au

Shijun Zhao ∗^{*}

Key Laboratory of Cyberspace

Security Defense

Institute of Information Engineering,

Chinese Academy of Sciences

Beijing, China

zhaoshijun@iie.ac.cn

Zhuang Lu

Key Laboratory of Cyberspace

Security Defense

Institute of Information Engineering,

Chinese Academy of Sciences

Beijing, China

luzhuang@iie.ac.cn

Rui Hou

Key Laboratory of Cyberspace

Security Defense

Institute of Information Engineering,

Chinese Academy of Sciences

Beijing, China

hourui@iie.ac.cn

Haibo Chen

Shanghai Jiao Tong University

Shanghai, China

haibochen@sjtu.edu.cn

Abstract

Microkernels provide good features such as high security, safety, and flexibility, but their reliance on hardware-based isolation leads to heavy performance overhead, limiting their

∗^{*}Corresponding author

Figure

This work is licensed under a Creative Commons Attribution 4.0 International License.

ASPLOS '27, Heraklion, Greece

© 2027 Copyright held by the owner/author(s).

ACM ISBN 979-8-4007-3012-2/2027/04

https://doi.org/10.1145/3845814.3850085

widespread adoption. Although constructing single-address-space microkernels based on safe language-based isolation is a promising approach to addressing the performance issue, this approach still faces challenges in maintaining the principle of minimality and enforcing capability-based, fine-grained access control over system resources. We propose safeL4, an approach to constructing microkernels based on safe languages. It guarantees minimality through low-level abstractions for unsafe operations, and implements a capability system based on the safe language's object capabilities to achieve fine-grained access control over all operations on system resources. We implement a prototype system in Rust, and our evaluation results show that the primitives provided by safeL4 are, on average, 1.9×1.9\times faster than those of seL4.

Zheyuan Xu et al.

CCS Concepts: • Software and its engineering → Operating systems.

Keywords: Microkernel, Safe Language, Capability System

ACM Reference Format:

Zheyuan Xu, Xiaobei Zhang, Zihan Li, Zekai Nie, Guangtao Zhu, Zhuang Lu, Qianying Zhang, Shijun Zhao, Haibo Chen, and Rui Hou. 2027. safeL4: Rethinking Safe-Language-Based Single Address Space Microkernels. In Proceedings of the 32nd ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1 (ASPLOS '27), April 11–15, 2027, Heraklion, Greece. ACM, New York, NY, USA, 18 pages. https://doi.org/10.1145/3845814.3850085

1 Introduction

Despite performance concerns, microkernels have long been regarded as offering significant advantages over monolithic kernels [35, 51], primarily in security, safety, and flexibility. First, microkernels adhere to the principle of minimality [50], ensuring that the trusted computing base (TCB) is as small as possible. Second, microkernels utilize capability systems [5, 44, 71] to implement fine-grained access control over system resources, thereby enforcing the principle of least privilege (PoLP) [39, 65]. The minimality principle and capability-based access control enable formal verification of the kernel [22], leading to the world's first formally verified operating system (OS) kernel, seL4 [42, 59, 70]. Finally, by partitioning OS services into domains that can be updated or replaced independently, microkernels achieve high flexibility. In the remainder of this paper, we refer to the domains protected by the microkernel as protection domains [45].

Microkernels, due to their advantages, were once envisioned as the basis for all types of operating systems [51]. However, since the first generation of microkernels [1], they have been used mainly in embedded and safety-critical environments (i.e., essentially static systems). In contrast, monolithic kernels remain the most prevalent and widely adopted kernel architecture. Emerging scenarios, such as smart vehicles, smartphones, trusted execution environments, containers, and confidential virtual machines, have strict security and safety requirements and therefore favor microkernels [15, 54, 55, 72, 83]. These scenarios are no longer limited to embedded systems and involve running general-purpose applications that demand a broad range of OS functionality.

Nevertheless, the hardware-based isolation used by microkernels imposes significant performance overhead in these scenarios, including context switches caused by inter-process communication (IPC), cross-address-space data transfers [20], and increased IPC frequency [15]. Although various measures have been proposed to mitigate the performance issues of microkernels, none has fundamentally solved the problem. For example, some OS designs [12, 15] place the most critical servers and drivers in the kernel, which conflicts with the principle of minimality; moreover, some measures duplicate kernel state across multiple servers [15], introducing extra overhead for state synchronization.

In fact, there is another technical approach that aims to design microkernels that do not rely on hardware-based isolation to eliminate the performance overhead, namely, the use of type-safe languages. These languages use type systems to define clear contracts for components (such as modules, structures, and functions), ensuring that each component interacts with others only through well-defined interfaces and preventing unauthorized access [13, 49]. Safe language-based microkernels and applications run in the same address space and the same CPU mode, i.e., a single-address-space OS (SASOS), but they still follow the common concept of a kernel, namely, “the part of the operating system that is mandatory and common to all other software” [50]. Such a language-based approach significantly reduces the performance overhead introduced by hardware isolation: cross-domain communication is simplified to function calls, and cross-domain data transfer is achieved via zero-copy object ownership transfer. Typical representatives of safe language-based microkernels include SPIN [3, 4], Singularity [24, 37, 38], and RedLeaf [60]. There are also some kernels that, although not explicitly claiming to be microkernels, have adopted certain microkernel features in their design, such as minimizing the TCB (Asterinas [62]) and fault isolation (Tock [47, 66], Theseus [7]).

However, current safe language-based kernels face two main issues in meeting microkernel requirements. First, these kernels lack a capability system for fine-grained access control over all system resources. A capability system is the principal mechanism microkernels use to restrict the system resources available to a protection domain (e.g., to eliminate ambient authority [58] and the confused deputy problem [31]), thereby enforcing PoLP and serving as a prerequisite for formal verification to achieve high trustworthiness. Consequently, modern microkernels such as seL4 [34], L4Re [41], and HongMeng [15] all adopt capability systems as a core mechanism. Unfortunately, conventional microkernel capability systems rely on hardware-based isolation to guarantee capability unforgeability, which incurs significant performance overhead when accessing capability-protected resources. Accessing a capability-protected kernel object in seL4 consumes 379 CPU cycles (Table 1), and this overhead primarily consists of CPU mode switching, capability lookup within the capability container (CNode), capability decoding (necessitated by the semantic gap between the user-space application and the kernel regarding capability metadata), and authority check.

The second issue is that the TCB of such kernels tends to become large. First, beyond the kernel code, the TCB includes toolchain libraries and third-party dependencies linked

d

Table 1. Profile of the access of a kernel object in seL4 on the Raspberry Pi 3B+ board (in CPU cycles).

Mode switchCap lookupCap decode & authority checkOthers†^{\dagger}Total
1395866116379

†^{\dagger} Remaining overhead (e.g., IPC-buffer lookup, extra capability lookup, and return-path scheduling).

Table 2. Comparison of safe language-based kernels in terms of minimality principle adherence and TCB size.

OSMinimalityLCS in the TCB
core + allocOthers†^{\dagger}
SPIN [4]✕ (memory mgr, thread mgr)--
Singularity [38]✕ (memory mgr, process mgr, IO mgr, scheduler)--
Tock [47, 66]✕ (process mgr, scheduler)1 9112 903
RedLeaf [60]✕ (memory mgr, scheduler)4 35717240
Theseus [7]✕ (memory mgr, scheduler)8 72040459
Asterinas [62]✕ (phy mem mgr)9 44211090

†^{\dagger} Linked code other than Rust core and alloc, including kernel/framework code and its direct or indirect unsafe dependencies required by the whole OS.

into the kernel image. Second, these kernels typically require all unsafe code to be encapsulated within the kernel, as allowing unsafe operations in protection domains would compromise the safe language-based isolation guarantees. We use the linked code size (LCS) metric [62] to count the total lines of code (LoC) linked into the kernel image. As detailed in Table 2, our evaluation of the functionality and LCS of several popular Rust-based kernels reveals that they do not follow the minimality principle, resulting in relatively large TCBs. Although Tock exhibits a smaller LCS, this is because it is a lightweight OS for low-power microcontrollers.

To address the above issues, we propose safeL4, a Rust-based single-address-space microkernel. The core idea of safeL4 is to construct capabilities that do not rely on hardware isolation, treating them as a first-class abstraction to uniformly provide protection domains with system resource abstractions that satisfy the microkernel minimality principle and fine-grained access control requirements. First, based on Rust's object capabilities (i.e., object references or pointers [9, 19, 29]), safeL4 constructs a capability system that does not require address space isolation for protection. It enforces fine-grained access control over system resources within a single address space (SAS), thereby reducing the performance overhead caused by crossing address spaces in traditional capability systems. Second, it adopts a microkernel approach to provide low-level abstractions for hardware resources and the communication functionality, and safely encapsulates only the essential unsafe operations, thereby reducing the TCB. Third, by utilizing a capability derivation tree and Rust's visibility control, it solves the problem that Rust's native object capabilities can neither record capability derivation relationships nor be revoked. This equips the capability system with interfaces of sufficiently rich semantics to support the kernel's management of system resources.

The contributions of this paper are summarized as follows.

  • We propose an approach to constructing a capability system for system resources based on Rust's features, which avoids the heavy overhead of hardware isolation-based capability systems and satisfies microkernels' minimality principle as well as the requirements for capability-based fine-grained access control.

  • We address the issue that Rust's native object capabilities fail to meet the management requirements of microkernels for system resources.

  • We build a prototype of safeL4 in Rust and implement core OS services. We support applications written in unsafe languages to run in user space. Evaluation results show that safeL4's safe abstraction achieves 1.91×1.91 \times the performance of seL4 on average, with IDC performance improving by 7.8×7.8 \times to 22.3×22.3 \times.

References (39)