Visible to the public EffectiveSan: Type and Memory Error Detection Using Dynamically Typed C/C++

TitleEffectiveSan: Type and Memory Error Detection Using Dynamically Typed C/C++
Publication TypeConference Paper
Year of Publication2018
AuthorsDuck, Gregory J., Yap, Roland H. C.
Conference NameProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation
Conference LocationNew York, NY, USA
ISBN Number978-1-4503-5698-5
Keywords(sub-)object bounds errors, bounds checking, C, C++, compositionality, Data Sanitization, dynamic types, Human Behavior, low-fat pointers, memory errors, privacy, pubcrawl, resilience, sanitizers, type checking, type confusion, Type errors, use-after-free errors
AbstractLow-level programming languages with weak/static type systems, such as C and C++, are vulnerable to errors relating to the misuse of memory at runtime, such as (sub-)object bounds overflows, (re)use-after-free, and type confusion. Such errors account for many security and other undefined behavior bugs for programs written in these languages. In this paper, we introduce the notion of dynamically typed C/C++, which aims to detect such errors by dynamically checking the "effective type" of each object before use at runtime. We also present an implementation of dynamically typed C/C++ in the form of the Effective Type Sanitizer (EffectiveSan). EffectiveSan enforces type and memory safety using a combination of low-fat pointers, type meta data and type/bounds check instrumentation. We evaluate EffectiveSan against the SPEC2006 benchmark suite and the Firefox web browser, and detect several new type and memory errors. We also show that EffectiveSan achieves high compatibility and reasonable overheads for the given error coverage. Finally, we highlight that EffectiveSan is one of only a few tools that can detect sub-object bounds errors, and uses a novel approach (dynamic type checking) to do so.
Citation Keyduck_effectivesan:_2018