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

被引:0
|
作者
Dudina, Irina [1 ]
Stark, Ian [1 ]
机构
[1] Univ Edinburgh, Edinburgh, Scotland
关键词
Static analysis; CHERI; Software porting;
D O I
10.1007/s10009-025-00781-6
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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, analyzed) and confirm by analyzing true-positive warning rates that the reports produced are sufficiently high quality for practical use.
引用
收藏
页数:13
相关论文
共 50 条
  • [1] Static Analysis for Transitioning to CHERI C/C plus
    Dudina, Irina
    Stark, Ian
    PROCEEDINGS OF THE 13TH ACM SIGPLAN INTERNATIONAL WORKSHOP ON THE STATE OF THE ART IN PROGRAM ANALYSIS, SOAP 2024, 2024, : 52 - 59
  • [2] CHERI: Hardware-Enabled C/C plus plus Memory Protection at Scale
    Watson, Robert N. M.
    Chisnall, David
    Clarke, Jessica
    Davis, Brooks
    Filardo, Nathaniel Wesley
    Laurie, Ben
    Moore, Simon W.
    Neumann, Peter G.
    Richardson, Alexander
    Sewell, Peter
    Witaszczyk, Konrad
    Woodruff, Jonathan
    IEEE SECURITY & PRIVACY, 2024, 22 (04) : 50 - 61
  • [3] Comparative Study on Static Code Analysis Tools for C/C plus
    Fatima, Anum
    Bibi, Shazia
    Hanif, Rida
    PROCEEDINGS OF 2018 15TH INTERNATIONAL BHURBAN CONFERENCE ON APPLIED SCIENCES AND TECHNOLOGY (IBCAST), 2018, : 465 - 469
  • [4] Static Analysis of Functors' Mathematical Properties in C plus plus Source Code
    Babati, Bence
    Pataki, Norbert
    INTERNATIONAL CONFERENCE ON NUMERICAL ANALYSIS AND APPLIED MATHEMATICS (ICNAAM-2018), 2019, 2116
  • [5] Analysis and Code Model Extraction for C/C plus plus Source Code
    Wagner, Christian
    Margaria, Tiziana
    Pagendarm, Hans-Georg
    2009 14TH IEEE INTERNATIONAL CONFERENCE ON ENGINEERING OF COMPLEX COMPUTER SYSTEMS (ICECCS), 2009, : 110 - +
  • [6] C/C plus plus Thread Safety Analysis
    Hutchins, DeLesley
    Ballman, Aaron
    Sutherland, Dean
    2014 14TH IEEE INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2014), 2014, : 41 - 46
  • [7] CoBOT: Static C/C plus plus Bug Detection in the Presence of Incomplete Code
    Gao, Qing
    Zhang, Shikun
    Chen, Xianglong
    Ma, Sen
    Shao, Sihao
    Sui, Yulei
    Zhao, Guoliang
    Ma, Luyao
    Ma, Xiao
    Duan, Fuyao
    Deng, Xiao
    2018 IEEE/ACM 26TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC 2018), 2018, : 385 - 388
  • [8] A Comparison of Open-Source Static Analysis Tools for Vulnerability Detection in C/C plus plus Code
    Arusoaie, Andrei
    Ciobaca, Stefan
    Craciun, Vlad
    Gavrilut, Dragos
    Lucanu, Dorel
    2017 19TH INTERNATIONAL SYMPOSIUM ON SYMBOLIC AND NUMERIC ALGORITHMS FOR SCIENTIFIC COMPUTING (SYNASC 2017), 2017, : 161 - 168
  • [9] Techniques for Memory-Efficient Model Checking of C and C plus plus Code
    Rockai, Petr
    Still, Vladimir
    Barnat, Jiri
    SOFTWARE ENGINEERING AND FORMAL METHODS, 2015, 9276 : 268 - 282
  • [10] Detection of Memory Leaks in C/C plus plus Code via Machine Learning
    Andrzejak, Artur
    Eichler, Felix
    Ghanavati, Mohammadreza
    2017 IEEE 28TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING WORKSHOPS (ISSREW 2017), 2017, : 252 - 258