Guest RAM That Never Reaches Disk: A Memory-Stop Hypervisor on Apple Silicon
A sealed machine promises that when its owner burns it, no recoverable copy of its plaintext survives, even while the host is powered on. On a Mac, that promise fails quietly: the host may compress or page a guest's live memory to its swap file, and a laptop that sleeps writes physical memory, wired pages included, to a hibernation image. Apple's Virtualization.framework offers no way to pin guest memory. We measured about 133 MB of one guest's memory in swap before writing a line of our own. This paper describes a minimal virtual-machine monitor on Apple's lower-level Hypervisor.framework, written in Swift with no external dependencies, whose one differentiating property is that the guest's memory is owned by us: mapped, wired with `mlock` before any secret exists, and scrubbed with a function the compiler may not remove on every exit path a program can intercept, before every announced sleep, and when a physical key is pulled. Every other device the higher framework would have given us for free, we rebuilt: a flat-image arm64 Linux boot with a hand-rolled devicetree, the in-kernel interrupt controller's three silent preconditions, a PL011 console with the PrimeCell identifiers that make the real driver bind, and virtio block, entropy, socket, display, input, clock and sound devices on a virtio-mmio transport. Each brick was accepted only when a judge we did not write said so: the guest kernel's own log, a package manager that verifies every byte it installs, hashes computed on opposite sides of a pipe, the host's own memory map, the host's own sandbox kernel, the MMU's guard pages, and the termination status the operating system reports. The same discipline found the defects: a cleanup that never runs on a signal, two signals the scrub did not list, an undecoded access the exit loop trusted, a bounds checker and a fit check that a guest could crash, two address additions that could wrap, a sampled scrub check that missed a screen full of text, a sleep that wiped the guest and left it running, a sound card that advertised the wrong format, and eight test rigs that lied. We report the measurements, the gotchas, the honest residuals that no software can close, and a checklist for anyone who wants to build their own.
Authors
- AriaLabs Systems LLC
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-28
- DOI
- https://doi.org/10.5281/zenodo.24638352
- Primary Topic
- Security and Verification in Computing
- Type
- preprint