[ Ссылка ]
—
Checked C: Adding Memory Safety to LLVM - Mandeep Singh Grang, Katherine Kjeer
Slides: [ Ссылка ]
—
Checked C is an open-source extension to C designed by Microsoft to guarantee spatial safety. Checked C adds static and dynamic checking to C to detect or prevent memory access violations. It introduces new "checked" pointer and array pointer types and requires the programmer to annotate these with bounds. It then uses the bounds to ensure the safety of memory accesses.
Checked C has been implemented in LLVM and Clang. In this talk, we describe the design of bounds annotations for checked pointers and array pointers in the Clang AST as well as the framework for the static checking of the soundness of bounds. We also briefly describe novel algorithms to automatically widen bounds for null-terminated arrays and for comparison of expressions for equivalence. We also report on some of the challenges we faced like undefined behavior due to integer overflow.
References:
1. Checked C language specification - [ Ссылка ]
2. Checked C project repo - [ Ссылка ]
3. Checked C Clang repo - [ Ссылка ]
4. Checked C SecDev 2018 paper - [ Ссылка ]
![](https://s2.save4k.ru/pic/EuxAzvtX9CI/maxresdefault.jpg)