Cornucopia: Temporal Safety for CHERI Heaps

  • Nathaniel Filardo ,
  • Brett F. Gutstein ,
  • Jonathan Woodruff ,
  • Sam Ainsworth ,
  • Lucian Paul-Trifu ,
  • Brooks Davis ,
  • Hongyan Xia ,
  • Edward Tomasz Napierala ,
  • Alexander Richardson ,
  • John Baldwin ,
  • David Chisnall ,
  • Jessica Clarke ,
  • Khilan Gudka ,
  • Alexandre Joannou ,
  • A. Theodore Markettos ,
  • Alfredo Mazzinghi ,
  • Robert Norton ,
  • Michael Roe ,
  • Peter Sewell ,
  • Stacey Son ,
  • Timothy M. Jones ,
  • Simon Moore ,
  • Peter G. Neumann ,
  • Robert N. M. Watson

IEEE Symposium on Security and Privacy |

Published by IEEE

Use-after-free violations of temporal memory safety continue to plague software systems, underpinning many high impact exploits. The CHERI capability system shows great promise in achieving C and C++ language spatial memory safety, preventing out-of-bounds accesses. Enforcing language-level temporal safety on CHERI requires capability revocation, traditionally achieved either via table lookups (avoided for performance in the CHERI design) or by identifying capabilities in memory to revoke them (similar to a garbage-collector sweep). CHERIvoke, a prior feasibility study, suggested that CHERI’s tagged capabilities could make this latter strategy viable, but modelled only architectural limits and did not consider the full implementation or evaluation of the approach.

Cornucopia is a lightweight capability revocation system for CHERI that implements non-probabilistic C/C++ temporal memory safety for standard heap allocations. It extends the CheriBSD virtual-memory subsystem to track capability flow through memory and provides a concurrent kernel-resident revocation service that is amenable to multi-processor and hardware acceleration. We demonstrate an average overhead of less than 2% and a worst case of 8.9% for concurrent revocation on compatible SPEC CPU2006 benchmarks on a multi-core CHERI CPU on FPGA, and we validate Cornucopia against the Juliet test suite’s corpus of temporally unsafe programs. We test its compatibility with a large corpus of C programs by using a revoking allocator as the system allocator while booting multi-user CheriBSD. Cornucopia is a viable strategy for always-on temporal heap memory safety, suitable for production environments.