Contributors:
- Jakub Jelinek
Delivery Date:
- 2005-03-01
Status:
- Committed.
Description:
- It is a set of builtin functions that allow protection against various buffer overflow (and format string) vulnerabilities. Compared to mudflap it has far smaller overhead, so all programs can be built with that without slowing down programs. GCC attempts to detect at compile time the upper (resp. lower) bound on number of bytes till the end of object(s) a pointer points to. For various string operations like memcpy, strcpy etc. it then checks if the call will never overflow past the end of that object (normal function is called or builtin expanded inline), if it might overflow (calls a checking variant of the function (for most functions it should be a few cycles extra constant cost at most) with the computed number of remaining bytes) and if any call to that function will necessarily overflow, it calls the checking function and issues a compile time warning.