TL;DR
Symbolic execution often "hits a wall" when encountering complex data types like strings or floating-point numbers because the underlying SMT solvers struggle with their intractable constraints. Indexify is a program transformation that maps these complex expressions onto a finite "Garden" of integer indices, turning undecidable or expensive constraints into simple equality logic that solvers can breeze through.
What Problem Does This Paper Address?
Symbolic execution (symex) is a powerful technique for finding bugs by exploring all possible paths through a program. However, it is fundamentally limited by the power of its constraint solver. When a program performs complex operations—like concatenating long strings or performing high-precision floating-point math—the resulting mathematical constraints are often "intractable."
Traditional tools handle this in two ways: static symex simply gives up on the path, while dynamic symex (concolic testing) "concretizes" the variables, picking a single real value to move forward. Concretization is a blunt instrument; it lets execution continue but loses the "symbolic" power to reason about other possible values. The authors identify a gap: we don't need to solve for every possible string in the universe, just the ones a specific program is likely to use.
Methods
The authors introduce a "program-centric" approach called Indexify. Instead of trying to improve the general-purpose SMT solver, they transform the program itself to make it easier to solve.
- Harvesting Seeds: The tool first scans the program for literal constants (e.g., the string "admin" or the float 3.14).
- Growing the Garden: It applies program operators to these seeds to generate a finite set of likely values, called the Garden (G). For example, if the seeds are "a" and "b" and the operator is concatenation, the Garden might include "aa", "ab", "ba", etc.
- Indexed Operator Tables (IOTs): The tool creates lookup tables that memoize the results of functions (like
strncmporsqrt) but only for values within the Garden. If an input falls outside this set, it returns a special "undefined" value ($\perp$). - Program Rewriting: The original program is rewritten to use these integer indices and IOTs.
This transformation creates a partial homomorphism: the new program is an "under-approximation" of the original. It can't reason about every possible state, but it can reason symbolically about a much larger subset of states than concolic testing can.
Datasets
The researchers evaluated Indexify using two primary benchmarks:
- GNU Coreutils: A suite of 89 basic UNIX command-line utilities (like
ls,rm,sort). This was used to test string-heavy operations. - fdlibm53: A widely used C math library, chosen to test the tool's effectiveness with floating-point constraints.
- Bugbench: A classic benchmark for C bug-finding tools, used to see if Indexify could find real-world crashes that other tools missed.
Key Insights and Ideas
- Program-Centric vs. Language-Centric: Most analysis tools try to handle everything the language allows. Indexify exploits the fact that any specific program only uses a tiny fraction of the possible values and operations allowed by the language.
- Trading Space for Time: Indexify generates significantly more clauses (up to 3x more) than standard symex because of the large lookup tables. However, because these clauses are simple equalities, the solver can simplify them so aggressively that the number of constraints actually reaching the solver's core drops by 90%.
- The "Unique Value" Surprise: While the theoretical size of the "Garden" grows exponentially, the authors found that in practice, only about 2% of generated values are unique. This makes the approach much more scalable than it appears on paper.
Key Results
Indexify showed dramatic improvements over standard KLEE (a state-of-the-art symex tool) and Zesti (a concolic tool):
- Speed: On
coreutils, the average time to completion dropped from 49.5 minutes to just 6.0 minutes. - Coverage: Branch coverage on
coreutilsjumped from 30.10% (KLEE) to 66.83% (Indexify). For floating-point code infdlibm53, coverage increased from 34.45% to 71.56%. - Bug Finding: Indexify successfully triggered two real-world bugs in
ncompressandmanthat standard KLEE could not reach due to solver timeouts.
Limitations and Future Work
- The "Garden" Boundary: If a program's execution requires a value not present in the pre-computed Garden, Indexify returns $\perp$ and the path is effectively lost. The tool is an under-approximation.
- Seed Selection: Currently, the tool relies on constants found in the source code. The authors suggest that incorporating values from documentation or external test suites could further improve the "Garden's" quality.
- Manual Configuration: While many parts are automated, users still need to specify which types or header files (like
string.h) they want to indexify. Fully automating the selection of "problematic" operators remains an open challenge.
Summary updated