MCPcopy Create free account
hub / github.com/asterinas/vostd

github.com/asterinas/vostd @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
8,968 symbols 28,685 edges 1,228 files ⚖ Apache-2.0 2,733 documented · 30% ● updated 6d ago★ 6317 open issues

Browse by type

⨍ Functions 7,307◇ Types & classes 1,661
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Formal Verification of Asterinas OSTD with Verus

docs verify verify (verus-lang/verus)

[!NOTE] This repository is currently in a transitional state: the components under ostd/src/sync, ostd/libs/id-alloc, ostd/src/io/io_port and ostd/src/boot/memory_region.rs track Asterinas v0.19.0, while every other OSTD component is still based on v0.16.0.

Overview

The vostd project provides a formally-verified version of OSTD, the (unofficial) standard library for OS development in safe Rust. OSTD encapsulates low-level hardware interactions—which require unsafe Rust—into a small set of high-level, safe abstractions, enabling complex, general-purpose OSes like Asterinas to be written entirely in safe Rust. By design, OSTD guarantees soundness: no undefined behavior is possible regardless of how its API is used. The goal of vostd is to bolster this soundness through formal verification with Verus.

This work is ongoing. Our current focus is OSTD's memory management and synchronization subsystems—core components directly tied to kernel memory safety—and we aim to extend verification to further parts of OSTD over time.

Publications

This project is tied to the following papers:

  • 🏆 CortenMM — CortenMM: Efficient Memory Management with Strong Correctness Guarantees, SOSP 2025 (Best Paper Award). Concurrency proofs for OSTD memory management. [paper] [code]
  • KVerus — KVerus: Scalable and Resilient Formal Verification Proof Generation for Rust Code, ASE 2026 (Industry Track). Retrieval-augmented, self-adaptive proof synthesis and repair for Verus. KVerus-generated proofs accepted upstream are tracked under the AI-assist label. [paper] [code]
  • StarVerus - StarVerus: LLM-Powered Multi-Agent Collaboration for Industrial Rust Code Verification Automation, KDD 2026 (ADS Track). Multi-agent verification for industrial Rust. [paper]
  • Beyond Benchmarks — Beyond Benchmarks: A Case Study of LLM-Generated Verus Specification Failures on Asterinas Vostd, ASE 2026 (Industry Track). [paper]

Bugs Found by Verification

Formal verification has surfaced real bugs in OSTD and the upstream Asterinas kernel, including undefined behavior, deadlocks, arithmetic overflows, and reachable panics. We track them in issue #645.

Project Structure

vostd/
├── dv/               # Build system
├── ostd/
│   ├── libs/         # Auxiliary libraries for OSTD
│   │   ├── align_ext/
│   │   ├── id-alloc/
│   │   └── ostd-pod/
│   ├── specs/        # Verus specifications
│   └── src/          # OSTD implementation and proofs
└── verified_libs/    # Auxiliary verified libraries
    ├── bitflags/
    └── vstd_extra/

Building

Prerequisites

Build Verus

make verus      # or: cargo dv bootstrap

Verus is cloned and built under tools/verus. If the download fails, clone it manually into tools/verus and re-run cargo dv bootstrap.

[!NOTE] We use our own fork of Verus, kept in sync with upstream. To build against upstream Verus instead, use cargo dv bootstrap --upstream-verus (however, we do not guarantee our code will always verify with the upstream version).

Verify

make                                                               # verify OSTD and its dependencies (or: cargo dv verify)
make verify-riscv                                                   # verify the RISC-V arch code of OSTD (or: cargo dv verify --target riscv64imac-unknown-none-elf)
make verify-loongarch                                               # verify the LoongArch arch code of OSTD (or: cargo dv verify --target loongarch64-unknown-none-softfloat)
cargo dv focus --package ostd                                       # ostd only, skip dependency proofs
cargo dv focus --package ostd -- --verify-only-module sync::rwlock  # verify one ostd module
cargo dv verify --package vstd_extra                                # the verified dependency crate

Partial verification selectors such as --verify-only-module require the focus command.

--package (-p) selects packages; --target selects the Rust target triple (default: x86_64-unknown-none).

Verify bzImage mappings on the Linux host target, assuming valid setup ELF address and offset ranges:

cargo dv verify -p linux-bzimage-builder --target x86_64-unknown-linux-gnu

Clean

make clean      # or: cargo dv clean          # remove build artifacts for a fresh build

Build & Docs

make build      # or: cargo dv build               # build the verification targets
make doc        # or: cargo dv doc --package ostd  # generate API docs at doc/index.html

[!NOTE] Run cargo dv build before invoking cargo dv doc directly.

The generated documentation can be found at doc/. An online version is also available.

IDE Support

Contributing

We welcome your contributions! Follow the VOSTD Verus Coding Guidelines for coding, specification, proof, naming, and organization conventions.

Before submitting:

  • Run make verus-upgrade (cargo dv bootstrap --upgrade) to update the supported Verus toolchain.
  • Run make fmt to format your changes, including the build tool in dv/; formatting is enforced.
  • For changes to OSTD or verified libraries, run make to verify them.

For changes to Verus itself, prefer contributing to upstream Verus to minimize differences between upstream and our fork.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 5,427
Function 1,880
Class 1,238
Enum 268
Interface 155

Languages

Rust97%
C3%
C++1%

Modules by API surface

kernel/src/fs/ext2/inode.rs105 symbols
kernel/src/fs/ramfs/fs.rs88 symbols
kernel/src/fs/overlayfs/fs.rs82 symbols
kernel/src/fs/utils/inode.rs79 symbols
kernel/src/fs/exfat/inode.rs78 symbols
kernel/comps/mlsdisk/src/layers/3-log/tx_log.rs73 symbols
kernel/comps/mlsdisk/src/layers/1-crypto/crypto_log.rs66 symbols
kernel/src/fs/utils/systree_inode.rs60 symbols
kernel/comps/mlsdisk/src/layers/2-edit/journal.rs59 symbols
kernel/comps/mlsdisk/src/layers/4-lsm/tx_lsm_tree.rs58 symbols
kernel/src/vm/vmar/mod.rs57 symbols
kernel/src/process/process/mod.rs55 symbols

For agents

$ claude mcp add vostd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page