Efficient memory safety for multicore processors reducing wasted space

CHERI-D Reincarnate: efficient multicore CHERI temporal memory safety through allocation reincarnation (draft version)

Hardware ArchitectureCryptography and Security

Summary

Programs sometimes make mistakes by using memory after they have freed it, which can cause crashes or security problems. The authors propose a system called Reinc that fixes this by reusing memory safely without waiting, keeping track of memory use in a smart way. Unlike older methods that had to hold onto freed memory for a long time, Reinc recycles it right away, which saves space and work. It works well even when many processor cores are running at once and they tested it with low overhead.

What this means in practice

  • For operating system developers: Improve security and memory efficiency by integrating Reinc into OS kernel memory management for handling freed memory safely on multicore systems.
  • For hardware designers: Design processor hardware with Reinc's architectural extensions to enable efficient temporal safety and low-overhead memory reuse in multicore chips.

Authors

Yuecheng Wang, Jonathan Woodruff, Simon W. Moore

Abstract

We propose CHERI-D Reincarnate (Reinc), an architectural extension to CHERI for scalable and efficient temporal memory safety. Prior work CHERI-D has a finite-width generation ID stored at a fixed location, requiring an object to be quarantined when its ID is exhausted. Reinc further provides use-after-free mitigation while permitting immediate freed memory reuse for objects through allocation reincarnation: rather than quarantining an allocation slot upon ID exhaustion, Reinc dynamically assigns a new ID to that slot when its current ID is exhausted. Exhausted IDs are quarantined and later reclaimed, while the underlying memory remains available for immediate reuse. By quarantining IDs rather than memory, Reinc enables continuous reuse of memory in the common case, substantially reducing both memory-sweep frequency and quarantine memory overhead. Reinc further introduces coherent ID caching while retaining a fully decentralized ID organization. Temporal metadata remains colocated with the memory it protects, preserving locality while avoiding centralized metadata structures. To support multicore execution, Reinc connects physical coherence events to the virtually addressed ObjID buffer using lightweight reverse-map and filter-based mechanisms. We implement Reinc as a hardware-software co-design spanning CHERI-Toooba (superscalar FPGA softcore), QEMU, LLVM/Clang and CheriBSD. Across our evaluated workloads, Reinc substantially reduces memory-sweep frequency and memory quarantine while incurring low performance and hardware overhead.