Bounds Checking with Taint-Based Analysis

Weihaw Chuang, Satish Narayanasamy, and Brad Calder

International Conference on High Performance Embedded Architectures & Compilers, January 2007


We analyze the performance of different bounds checking implementations. Specifically, we examine using the x86 {\tt bound} instruction to reduce the run-time overhead. We also propose a compiler optimization that prunes the bounds checks that are not necessary to guarantee security. The optimization is based on the observation that buffer overflow attacks are launched through external inputs. Therefore, it is sufficient to bounds check only the accesses to those data structures that can possibly hold the external inputs. Also, it is sufficient to bounds check only the memory writes. The proposed optimizations reduce the number of required bounds checks as well as the amount of meta-data that need to be maintained to perform those checks.