Cauldron 2013 - GCC Plugin for Light Weight Bounds Checking
Channel: Diego Novillo
Date: 2013-07-24

Presenter: Niranjan Hasabnis

Abstract:
Buffer overflow, a sub-class of more general problem called as out-of-bound
access error, is very old but still very prevalent security problem. Although the
research community has proposed a number of solutions to this problem, very
few are deployed within production compilers. In the context of GCC, Mudflap is a
popular plug-in for detecting buffer overflows, but it has high overheads, and
moreover, does not detect bounds errors that occur due to crossing of object
boundaries. High overheads make it hard to deploy Mudflap as a runtime
defence.
We have developed LBC (Light-weight Bounds Checker) that addresses the
drawbacks of Mudflap. LBC inserts guard zones between objects, thereby
enabling it to detect overflows missed by Mudflap. LBC uses an innovative
metadata representation that avoids additional memory accesses in the common
case, thus yielding performance that is much closer to normal performance. As a
result of this representation, LBC's overhead is typically a quarter of that of
Mudflap, even though LBC detects a larger class of errors than Mudflap.
We have already implemented LBC (available at http://www.seclab.cs.sunysb.
edu/lbc/) using a C-programming language transformation framework called CIL
[IEEE/ACM Code Generation and Optimization, 2012]. However, since CIL is not
widely deployed, this implementation of LBC is not readily available to the wider
community of C and C++ programmers. We have therefore developed a new
design of LBC as a plug-in for GCC. By operating on the GIMPLE, LBC supports
all input languages and target architectures that GCC supports. Using our current
implementation of the plug-in, we can compile and produce SPEC 2000 and
2006 benchmark results. We plan to test the plug-in on complex packages and
release it to the open-source community before the summit.