Strict Capabilities with a PNVI Escape Hatch
Abstract
Capability systems enforce memory safety by tying pointers to their originating allocations, preventing forgery, use-after-free, and out-of-bounds accesses. Yet conventional capabilities are simultaneously too strict and not strict enough for C: they reject common low-level idioms involving integer casts or raw pointer bytes, while failing to enforce type correctness and sub-object bounds. Proposed Provenance Not Via Integers (PNVI) semantics expose this tension by permitting representation-level manipulation while retaining strict rules for ordinary pointer operations. We argue that these requirements call for two interoperable abstractions rather than a compromise within one. Strict capabilities enforce provenance, liveness, type correctness, and (sub-)object bounds; ordinary capability operations preserve these invariants. Exposed representations are non-dereferenceable, integer-like values that support arbitrary integer and byte-level manipulation under PNVI semantics while retaining unforgeability guarantees. They carry no directly usable memory-access authority: converting an exposed representation back to a strict capability reconstructs provenance under PNVI rules and validates type and bounds before access. Thus, low-level C idioms can use an explicit escape hatch without weakening ordinary capability derivation. We realize this design using Fully Randomized Pointers (FRP) and dynamic type metadata. Evaluation on low-level pointer idioms, Juliet tests, and existing C benchmarks shows that strict type and sub-object safety can coexist with low-level pointer manipulation.
- Comment
- 22 pages, 1 figure, 2 tables