Skip to content

BYO-OS: optional per-component memory isolation — native MPU/PMP-program-on-switch TCB (+ synth#377 dependency) #86

Description

@avrabe

Context

In the dissolved (library-OS) BYO-OS mode, verified components + scheduler + app link into one native ELF in a single address space. Memory safety of the verified core is by construction (Verus/Kani: no OOB/over/underflow). But that is "no bugs in verified code," not containment of (a) the unverified seam-TCB or (b) a co-located untrusted/unverified component (e.g. a 3rd-party driver). synth does not provide inter-component isolation here:

  • --native-pointer-abi (used by the pointer-passing modules / gust) deliberately uses real native pointers — no linmem sandbox.
  • --safety-bounds {software,mpu} exists but is a no-op on the optimized codegen path today — blocked by synth#377.

So today's gust is safe only because it's a single verified failsafe task. The moment multiple mutually-distrusting components are dissolved together, isolation is an explicit, unbuilt design item.

Proposal (OPT-IN)

Make per-component memory isolation an option, layered on top of verification (which stays the primary line), enabled where the use-case/hardware warrants:

  1. Native MPU/PMP-program-on-switch TCB (C-free): a thin Rust TCB that programs ARM MPU / RV32 PMP regions per task/partition and reprograms on context switch. gale already verifies the partition arithmetic + non-overlap (src/mem_domain.rs, src/mpu.rs, MpuRegion.lean); the Zephyr drop-in lets C do the register writes — the BYO-OS path needs this in the native TCB.
  2. (Optional) software bounds as belt-and-suspenders — gated on synth#377 (so --safety-bounds software actually emits checks on the optimized path).

Default vs option

  • Default: verification-only (smallest TCB, zero isolation overhead) — correct when all co-located components are verified.
  • Option: +mpu per-switch partitions for containing the seam-TCB and/or unverified components — pay the MPU-reprogram cost only when you need the boundary.

Kill-criterion

"A dissolved component can read/write another partition's memory after a context switch with +mpu enabled" → isolation broken.

Tracks under gale#74 (BYO-OS). Depends on: synth#377 (for the software-bounds option).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions