Testing for buffer overflows with length abstraction

  • Authors:
  • Ru-Gang Xu;Patrice Godefroid;Rupak Majumdar

  • Affiliations:
  • University of California, Los Angeles, CA, USA;Microsoft Research, Redmond, WA, USA;University of California, Los Angeles, CA, USA

  • Venue:
  • ISSTA '08 Proceedings of the 2008 international symposium on Software testing and analysis
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present Splat, a tool for automatically generating inputs that lead to memory safety violations in C programs. Splat performs directed random testing of the code, guided by symbolic execution. However, instead of representing the entire contents of an input buffer symbolically, Splat tracks only a prefix of the buffer symbolically, and a symbolic length that may exceed the size of the symbolic prefix. The part of the buffer beyond the symbolic prefix is filled with concrete random inputs. The use of symbolic buffer lengths makes it possible to compactly summarize the behavior of standard buffer manipulation functions, such as string library functions, leading to a more scalable search for possible memory errors. While reasoning only about prefixes of buffer contents makes the search theoretically incomplete, we experimentally demonstrate that the symbolic length abstraction is both scalable and sufficient to uncover many real buffer overflows in C programs. In experiments on a set of benchmarks developed independently to evaluate buffer overflow checkers, Splat was able to detect buffer overflows quickly, sometimes several orders of magnitude faster than when symbolically representing entire buffers. Splat was also able to find two previously unknown buffer overflows in a heavily-tested storage system.