Interprocedural and Flow-Sensitive Type Analysis for Memory and Type Safety of C Code

  • Authors:
  • Syrine Tlili;Mourad Debbabi

  • Affiliations:
  • Concordia University, Montreal, Canada H3G 1M8;Concordia University, Montreal, Canada H3G 1M8

  • Venue:
  • Journal of Automated Reasoning
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

The explicit memory management and type conversion endow the C language with flexibility and performance that render it the de facto language for system programming. However, these appealing features come at the cost of programs' safety. Due to the C language permissiveness, highly skilled but inadvertent programmers often spawn insidious programming errors that yield exploitable code. In this paper, we present a novel type and effect analysis for detecting memory and type errors in C source code. We extend the standard C type system with effect, region, and host annotations that hold valuable safety information. We also define static safety checks to detect safety errors using the aforementioned annotations. Our analysis performs in an intraprocedural phase and an interprocedural phase. The flow-sensitive and alias-sensitive intraprocedural phase propagates type annotations and applies safety checks at each program point. The interprocedural phase generates and propagates unification constraints on type annotations across function boundaries. We present an inference algorithm that automatically infers type annotations and applies safety checks to programs without programmers' interaction.