21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

112 T.-C. Chiueh<br />

Despite its robustness advantage, most real-world programs do not <strong>in</strong>corporate<br />

array bounds check<strong>in</strong>g, because its performance penalty is too high to be considered<br />

practical. Whereas almost all previous research <strong>in</strong> this area focused on<br />

static analysis techniques to reduce redundant bounds checks and thus m<strong>in</strong>imize<br />

the check<strong>in</strong>g overhead, this work took a completely different approach that relies<br />

on the debug register hardware feature available <strong>in</strong> most ma<strong>in</strong>stream CPUs. By<br />

leverag<strong>in</strong>g debug registers’ address monitor<strong>in</strong>g capability, Boud can accurately<br />

detect array bound violations almost for free, i.e., without <strong>in</strong>curr<strong>in</strong>g any perarray-reference<br />

overhead most of the time. We have successfully built a Boud<br />

prototype based on the bound-check<strong>in</strong>g GCC compiler under Red Hat L<strong>in</strong>ux<br />

7.2. The current Boud prototype can check bound violations for array references<br />

both with<strong>in</strong> and outside loops, although it applies debug register-based<br />

bounds check<strong>in</strong>g only to with<strong>in</strong>-loop array references. Performance measurements<br />

collected from runn<strong>in</strong>g a set network applications on the Boud prototype<br />

demonstrate that the throughput and latency penalty of Boud’s array bounds<br />

check<strong>in</strong>g mechanism is below 7.7% and 8.8%, respectively, when compared with<br />

the vanilla GCC compiler, which does not perform any bounds check<strong>in</strong>g. This<br />

puts Boud as one of the fastest array bounds check<strong>in</strong>g compilers ever reported<br />

<strong>in</strong> the literature for C programs on the X86 architecture.<br />

References<br />

1. Perens, B.: Electric fence: a malloc() debugger for l<strong>in</strong>ux and unix.<br />

http://perens.com/FreeSoftware/<br />

2. Bentley, C., Watterson, S.A., Lowenthal, D.K.: A comparison of array bounds<br />

check<strong>in</strong>g on superscalar and vliw architectures. In: The annual IEEE Workshop on<br />

Workload Characterization (submitted)<br />

3. Lam, L.-C., Chiueh, T.-C.: Check<strong>in</strong>g array bound violation us<strong>in</strong>g segmentation<br />

hardware. In: DSN 2005. Proceed<strong>in</strong>gs of 2005 International Conference on Dependable<br />

Systems and Networks (June 2005)<br />

4. Cowan, C., et al.: Stackguard: Automatic adaptive detection and prevention of<br />

buffer-overflow attacks. In: Proc. 7th USENIX Security Conference, San Antonio,<br />

Texas, pp. 63–78 (January 1998)<br />

5. GCC. Bounds-check<strong>in</strong>g gcc, http://www.gnu.org/software/gcc/projects /bp/<br />

ma<strong>in</strong>.html<br />

6. Pearson, G.: Array bounds check<strong>in</strong>g with turbo c. Dr. Dobb’s Journal of Software<br />

Tools 16(5) 72, 74, 78–79, 81–82, 104–107 (1991)<br />

7. Patil, H., Fischer, C.N.: Efficient run-time monitor<strong>in</strong>g us<strong>in</strong>g shadow process<strong>in</strong>g.<br />

In: Proceed<strong>in</strong>gs of Automated and Algorithmic Debugg<strong>in</strong>g Workshop, pp. 119–132<br />

(1995)<br />

8. Xi, H., Pfenn<strong>in</strong>g, F.: Elim<strong>in</strong>at<strong>in</strong>g array bound check<strong>in</strong>g through dependent types.<br />

In: SIGPLAN Conference on Programm<strong>in</strong>g Language Design and Implementation,<br />

pp. 249–257 (1998)<br />

9. Xi, H., Xia, S.: Towards array bound check elim<strong>in</strong>ation <strong>in</strong> java virtual mach<strong>in</strong>e<br />

language. In: Proceed<strong>in</strong>gs of CASCON 1999, Mississauga, Ontario, pp. 110–125<br />

(November 1999)<br />

10. Intel. IA-32 Intel Architecture Software Developer’s Manual vol. 2 Instruction Set<br />

Reference, http://www.<strong>in</strong>tel.com/design/Pentium4/manuals/

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!