C to checked C by 3c

10Citations
Citations of this article
13Readers
Mendeley users who have this article in their library.

Abstract

Owing to the continued use of C (and C++), spatial safety violations (e.g., buffer overflows) still constitute one of today's most dangerous and prevalent security vulnerabilities. To combat these violations, Checked C extends C with bounds-enforced checked pointer types. Checked C is essentially a gradually typed spatially safe C - checked pointers are backwards-binary compatible with legacy pointers, and the language allows them to be added piecemeal, rather than necessarily all at once, so that safety retrofitting can be incremental. This paper presents a semi-automated process for porting a legacy C program to Checked C. The process centers on 3C, a static analysis-based annotation tool. 3C employs two novel static analysis algorithms - typ3c and boun3c - to annotate legacy pointers as checked pointers, and to infer array bounds annotations for pointers that need them. 3C performs a root cause analysis to direct a human developer to code that should be refactored; once done, 3C can be re-run to infer further annotations (and updated root causes). Experiments on 11 programs totaling 319KLoC show 3C to be effective at inferring checked pointer types, and experience with previously and newly ported code finds 3C works well when combined with human-driven refactoring.

References Powered by Scopus

Abstract interpretation: "A" unified lattice model for static analysis of programs by construction or approximation of fixpoints

4590Citations
N/AReaders
Get full text

SoK: Eternal war in memory

564Citations
N/AReaders
Get full text

Garbage collection in an uncooperative environment

395Citations
N/AReaders
Get full text

Cited by Powered by Scopus

TEEzz: Fuzzing Trusted Applications on COTS Android Devices

13Citations
N/AReaders
Get full text

Aliasing Limits on Translating C to Safe Rust

5Citations
N/AReaders
Get full text

Ownership Guided C to Rust Translation

5Citations
N/AReaders
Get full text

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Cite

CITATION STYLE

APA

Machiry, A., Kastner, J., Mccutchen, M., Eline, A., Headley, K., & Hicks, M. (2022). C to checked C by 3c. Proceedings of the ACM on Programming Languages, 6(OOPSLA1). https://doi.org/10.1145/3527322

Readers' Seniority

Tooltip

PhD / Post grad / Masters / Doc 2

50%

Professor / Associate Prof. 1

25%

Researcher 1

25%

Readers' Discipline

Tooltip

Computer Science 4

100%

Article Metrics

Tooltip
Social Media
Shares, Likes & Comments: 130

Save time finding and organizing research with Mendeley

Sign up for free