The libsafe library protects a process against the exploitation of buffer overflow vulnerabilities in process stacks. The method intercepts all calls to library functions that are known to be vulnerable. A substitute version of the corresponding function implements the original functionality, but in a manner that ensures that any buffer overflows are contained within the current stack frame. Libsafe has been shown to detect several known attacks and can potentially prevent yet unknown attacks.
Experiments indicate that the performance overhead of libsafe is negligible.