From 1874f77dc2bed4915a9ec810e20f905bf3c761fe Mon Sep 17 00:00:00 2001 From: tedu <> Date: Thu, 16 Oct 2003 17:05:05 +0000 Subject: by popular demand, malloc guard pages. insert an unreadable/unwriteable page after each page size allocation to detect overrun. this is somewhat electric fence like, while attempting to be mostly usable in production. also, use tdeval's chunk randomization code. enabled with the G option. ok deraadt and co. --- src/lib/libc/stdlib/malloc.3 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/libc/stdlib/malloc.3') diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3 index 6cbf638173..2af8900656 100644 --- a/src/lib/libc/stdlib/malloc.3 +++ b/src/lib/libc/stdlib/malloc.3 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: malloc.3,v 1.31 2003/09/26 05:57:02 millert Exp $ +.\" $OpenBSD: malloc.3,v 1.32 2003/10/16 17:05:04 tedu Exp $ .\" .Dd August 27, 1996 .Dt MALLOC 3 @@ -193,6 +193,12 @@ at exit. This option requires the library to have been compiled with -DMALLOC_STATS in order to have any effect. .Pp +.It Cm G +Enable guard pages and chunk randomization. +Each page size or larger allocation is followed by a guard page that will +cause a segmentation fault upon any access. +Smaller than page size chunks are returned in a random order. +.Pp .It Cm J .Dq Junk . Fill some junk into the area allocated. -- cgit v1.2.3-55-g6feb