Re:How OpenBSD Leverages Malloc to Find Bugs
by marshray on Monday November 28, 2011 @12:17PM
(#3286678)
Yes, the OpenBSD technique of completely unmapping the memory rather than re-using it will be able to catch even some read accesses, not just write accesses that happen to corrupt malloc's guards.
> MALLOC_CHECK_ is designed to be tolerant against simple errors, such as double calls of free() with the same argument, or overruns of a single byte (off-by-one bugs). Not all such errors can be protected against, however, and memory leaks can result.
> If MALLOC_CHECK_ is set to 0, any detected heap corruption is silently ignored;
> if set to 1, a diagnostic message is printed on stderr;
> if set to 2, abort(3) is called immediately;
> if set to 3, a diagnostic message is printed on stderr and the program is aborted.