Asterinas : A Linux ABI-Compatible, Rust-Based Framekernel OS with a Small and Sound TCB

Yuke Peng , Hongliang Tian , Junyang Zhang, Ruihan Li, Chengjun Chen, Jianfeng Jiang, Jinyi Xian, Xiaolin Wang, Chenren Xu, Diyu Zhou, Yingwei Luo , Shoumeng Yan , Yinqian Zhang · 2025

Read Asterinas : A Linux ABI-Compatible, Rust-Based Framekernel OS with a Small and Sound TCB by Yuke Peng , Hongliang Tian , Junyang Zhang, Ruihan Li, Chengjun Chen, Jianfeng Jiang, Jinyi Xian, Xiaolin Wang, Chenren Xu, Diyu Zhou, Yingwei Luo , Shoumeng Yan , Yinqian Zhang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-03876.txt.

Introduction

Yuke Peng and co-authors present a 2025 paper on a new operating system built in the Rust language. The system works with Linux programs and keeps its trusted core small and sound. Past Rust systems used unsafe code in ways that broke that aim. The team proposes a new frame, called a framekernel, to split rights inside the kernel.

Their base tool, OSTD, supports safe system building in Rust. The full system, Asterinas, runs more than 210 Linux calls. Its speed is on par with Linux in their tests. Only about 14 percent of its code must be trusted for memory safety. The work shows a safe design can still be fast and full.

Catalog record

CREATORYuke Peng , Hongliang Tian , Junyang Zhang, Ruihan Li, Chengjun Chen, Jianfeng Jiang, Jinyi Xian, Xiaolin Wang, Chenren Xu, Diyu Zhou, Yingwei Luo , Shoumeng Yan , Yinqian Zhang
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE62 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2506-03876

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Asterinas : A Linux ABI-Compatible, Rust-Based Framekernel OS with a Small and Sound TCB Yuke Peng , Hongliang Tian , Junyang Zhang, Ruihan Li, Chengjun Chen, Jianfeng Jiang, Jinyi Xian, Xiaolin Wang, Chenren Xu, Diyu Zhou, Yingwei Luo , Shoumeng Yan , Yinqian Zhang Abstract How can one build a feature-rich , general-purpose , Rust-based operating system (OS) with a minimal and sound Trusted Computing Base (TCB) for memory safety ? Existing Rust-based OSes fall short due to their improper use of unsafe Rust in kernel development. To address this challenge, we propose a novel OS architecture called framekernel that realizes Rust’s full potential to achieve intra-kernel privilege separation , ensuring TCB minimality and soundness. We present Ostd , a streamlined framework for safe Rust OS development, and Asterinas , a Linux ABI-compatible framekernel OS implemented entirely in safe Rust using Ostd . Supporting over 210 Linux system calls, Asterinas delivers performance on par with Linux, while maintaining a minimized, memory-safety TCB of only about 14.0% of the codebase. These results underscore the practicality and benefits of the framekernel architecture in building safe and efficient OSes. 1 Introduction Despite three decades of research into defending against memory safety bugs in operating systems (OSes) written in C, achieving true memory safety remains elusive. This was starkly demonstrated by the recent CrowdStrike outage [ 11 ] , where millions of Windows PCs crashed due to an out-of-bounds memory access in a faulty driver. It is estimated that 60-70% of security vulnerabilities in system software written in C stem from memory safety issues [ 30 ] . In recent years, as the Rust programming language matures and becomes popular, the development of Rust-based, memory-safe OSes has gained momentum. Rust offers memory safety guarantees through innovative language features such as ownership, borrowing, and lifetimes, enabling safe memory management without relying on garbage collection. Many now see Rust as a potential successor to C and C++ as the dominant systems programming language. With the endorsement of Linus Torvalds, the Linux kernel has officially adopted Rust as its second programming language [ 18 ] and integrated the Rust for Linux [ 41 ] (RFL) project to facilitate writing "leaf" kernel modules in Rust. Additionally, new OS kernels like Tock [ 38 ] , RedLeaf [ 49 ] , and Theseus [ 16 ] are built from the ground up using Rust, further demonstrating Rust’s potential in this domain. Table 1: The unsafe keyword is widely utilized in the crates (or kernel modules) of existing Rust-based OSes. The statistics were derived from an analysis of the latest source code of these OSes at the time of writing. Rust-based OSes Linux Tock RedLeaf Theseus Unsafe -utilizing crates 6 / 11 1 91 / 98 36 / 58 54 / 171 (55%) (93%) (62%) (32%) 1 This includes the RFL crate and 10 notable Rust-written kernel modules [ 3 ] . While adopting Rust is a significant step toward achieving kernel memory safety, this is insufficient on its own since Rust-based OSes must include unsafe Rust code. The safety of the kinds of low-level controls required by kernel programming cannot be statically verified by the Rust compiler and thus is only allowed by Rust within special code blocks marked by the unsafe keyword. Despite the Rust language team dedicating an entire book [ 25 ] to the “dark arts of unsafe Rust”, developers are still prone to misusing it, and the RustSec Advisory Database has recorded hundreds of bugs stemming from unsafe misuse [ 60 ] . To mitigate the risks associated with unsafe in Rust, two widely accepted best practices have emerged [ 12 ] : (1) use unsafe sparingly and (2) encapsulate unsafe code within safe abstractions. However, we have found that existing Rust-based OS kernels often fall short of these standards. Unsafe Rust code permeates a significant portion of a Rust-based OS. We observe that unsafe -utilizing crates make up 55%, 93%, 62%, and 32% of all crates in Linux, Tock, RedLeaf, and Theseus, respectively (as shown in Table 1 ). Although kernel developers generally view unsafe as a “necessary evil”, we question whether such widespread use of unsafe is truly necessary. In particular, we challenge the necessity of unsafe in device drivers (as seen in all existing Rust-based OSes), which account for the majority of the codebase of a mature OS (70% in Linux [ 17 ] ). Details about the pitfalls of unsafe handling in existing Rust OSes will be present in section 2 . Given the limitations of prior work, we pose the question: is it possible to build a feature-rich, general-purpose, Rust-based OS kernel almost entirely in safe Rust? We introduce framekernel ( section 3 ), a novel OS architecture designed to achieve a minimal and sound TCB for a Rust-based OS. In the framekernel architecture, the entire OS resides in a single address space (as in a monolithic kernel) and is implemented in Rust. The kernel is logically divided into two parts: the privileged OS framework (akin to a microkernel) and the de-privileged OS services. Only the privileged framework is allowed to use unsafe , while the de-privileged services must be written in safe Rust completely. As the TCB, the privileged framework encapsulates all low-level, hardware-oriented unsafe operations behind safe APIs. Using these safe APIs, the de-privileged OS services can implement all kinds of OS functionalities, including device drivers. A framekernel minimizes the TCB size without incurring extra overheads due to hardware isolation. Thus, we claim that a framekernel combines the benefits of both a monolithic kernel and a microkernel (see Figure 1 ). We enforce this language-based, intra-kernel privilege separation by systematically identifying sensitive OS resources, namely those that can be mis-programmed or misused to compromise memory safety – even with safe Rust. Thus, the design principle of a framekernel is to keep sensitive OS resources within the privileged framework for soundness, while delegating insensitive OS resources to the de-privileged OS services for minimality . To realize the vision of framekernels, we develop Ostd ( section 4 ), the privileged OS framework required by a framekernel. Ostd provides a small yet expressive set of safe OS development abstractions, covering safe user-kernel interactions, safe kernel logic, and safe kernel-peripheral interactions. Of particular note is the untyped memory abstraction, which addresses the challenge of safely handling externally-modifiable memory (e.g., MMIO or DMA-capable memory) – a longstanding obstacle in safe driver development. In addition, we introduce safe policy injection , a technique that separates potentially complex "policy" components (e.g., task schedulers, page allocators, and slab allocators) from the core "mechanisms" of Ostd , thus containing the growth of Ostd ’s complexity over time. Furthermore, we define a set of key safety invariants that collectively ensure the soundness of Ostd ’s privilege separation. To demonstrate the practicality and benefits of framekernels, we develop Asterinas ( section 5 ), a Linux ABI–compatible framekernel built on Ostd . Asterinas implements a rich subset of Linux functionality: it supports over 210 Linux system calls, multiple file systems and socket types, and a variety of peripherals (e.g., disks and NICs). All these features are written in safe Rust, leveraging Ostd ’s APIs. Asterinas has been under development for

Read the complete text