CheckedCBox: Type Directed Program Partitioning with Checked C for Incremental Spatial Memory Safety

02/03/2023
by   Liyi Li, et al.
0

Spatial memory safety violation is still a major issue for C programs. Checked-C is a safe dialect of C and extends it with Checked pointer types and annotations that guarantee spatial memory safety in a backward-compatible manner, allowing the mix of checked pointers and regular (unchecked) pointer types. However, unchecked code vulnerabilities can violate the checked code's spatial safety guarantees. We present CheckedCBox, which adds a flexible, type-directed program partitioning mechanism to Checked-C, by enhancing the Checked-C type system with tainted types that enable flexible partitioning of the program into checked and unchecked regions, in a manner such that unchecked region code does not affect the spatial safety in the checked region. We formalize our type system and prove the non-crashing and non-exposure properties of a well-typed CheckedCBox program. We implemented CheckedCBox in a configurable manner, which enables us to use existing sandbox mechanisms (eg WebAssembly) to execute programs. Consequently, in doing so, CheckedCBox has prevented four known vulnerabilities by efficiently partitioning the program.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/25/2022

C to Checked C by 3C

Owing to the continued use of C (and C++), spatial safety violations (e....
research
01/31/2022

A Formal Model of Checked C

We present a formal model of Checked C, a dialect of C that aims to enfo...
research
06/29/2019

Deciding Memory Safety for Forest Datastructures

Memory safety is the problem of determining if a heap manipulating progr...
research
06/13/2023

Friend or Foe Inside? Exploring In-Process Isolation to Maintain Memory Safety for Unsafe Rust

Rust is a popular memory-safe systems programming language. In order to ...
research
09/06/2023

Reference Capabilities for Flexible Memory Management: Extended Version

Verona is a concurrent object-oriented programming language that organis...
research
11/16/2018

Precondition Inference via Partitioning of Initial States

Precondition inference is a non-trivial task with several applications i...
research
10/21/2019

Memory Safety Preservation for WebAssembly

WebAssembly (Wasm) is a next-generation portable compilation target for ...

Please sign up or login with your details

Forgot password? Click here to reset