Static analysis to make the most of CHERI C/C++ for existing code: improving memory safety at scale

Abstract We describe and evaluate custom static analyses to support transitioning existing C/C++ codebases to CHERI hardware. CHERI is a novel architectural extension, implemented for RISC-V and AArch64, that uses capabilities to provide fine-grained memory protection and scalable software compartmentalization. While the existing CHERI toolchain can recompile large code collections for the platform with only a few source changes, those changes are nonetheless critical: we demonstrate that static analysis can help to identify where they are needed and what must be done to avoid later runtime faults. We provide custom checkers for the Clang Static Analyzer to handle capability alignment, copying through memory, and manipulation as integers. Beyond simply picking up problems in existing code, we also have checkers that identify where code can take advantage of capabilities to better enforce least privilege and improve spatial memory safety. We evaluate all implemented checkers on a sample of packages from the CheriBSD ports library (408 packages, "Equation missing" analyzed) and confirm by analyzing true-positive warning rates that the reports produced are sufficiently high quality for practical use.

Authors

Institutions

Publication Details

Journal
International Journal on Software Tools for Technology Transfer
Published
2025-02-20
DOI
https://doi.org/10.1007/s10009-025-00781-6
Citations
1
Primary Topic
Parallel Computing and Optimization Techniques
Type
article
Field-Weighted Citation Impact
2.27
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Static analysis to make the most of CHERI C/C++ for existing code: improving memory safety at scale

Ian Stark, Irina Dudina
1 citations
International Journal on Software Tools for Technology Transfer
Parallel Computing and Optimization Techniques
2.27
article

Static analysis to make the most of CHERI C/C++ for existing code: improving memory safety at scale

Ian Stark, Irina Dudina
article en
1 citations

Abstract

Abstract We describe and evaluate custom static analyses to support transitioning existing C/C++ codebases to CHERI hardware. CHERI is a novel architectural extension, implemented for RISC-V and AArch64, that uses capabilities to provide fine-grained memory protection and scalable software compartmentalization. While the existing CHERI toolchain can recompile large code collections for the platform with only a few source changes, those changes are nonetheless critical: we demonstrate that static analysis can help to identify where they are needed and what must be done to avoid later runtime faults. We provide custom checkers for the Clang Static Analyzer to handle capability alignment, copying through memory, and manipulation as integers. Beyond simply picking up problems in existing code, we also have checkers that identify where code can take advantage of capabilities to better enforce least privilege and improve spatial memory safety. We evaluate all implemented checkers on a sample of packages from the CheriBSD ports library (408 packages, "Equation missing" analyzed) and confirm by analyzing true-positive warning rates that the reports produced are sufficiently high quality for practical use.

International Journal on Software Tools for Technology TransferVol. 27(2)
University of Edinburgh (GB)
Openalex Percentile: Top 18%
Parallel Computing and Optimization Techniques
2.27
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.