diff options
author | tedu <> | 2003-10-16 17:05:05 +0000 |
---|---|---|
committer | tedu <> | 2003-10-16 17:05:05 +0000 |
commit | 1874f77dc2bed4915a9ec810e20f905bf3c761fe (patch) | |
tree | 0701ccc022b8088a090f2de342f002c592fc744d /src/lib/libc/stdlib/malloc.3 | |
parent | 9c41a5aafdf165f4bfe54930f369850d9425f840 (diff) | |
download | openbsd-1874f77dc2bed4915a9ec810e20f905bf3c761fe.tar.gz openbsd-1874f77dc2bed4915a9ec810e20f905bf3c761fe.tar.bz2 openbsd-1874f77dc2bed4915a9ec810e20f905bf3c761fe.zip |
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.
Diffstat (limited to 'src/lib/libc/stdlib/malloc.3')
-rw-r--r-- | src/lib/libc/stdlib/malloc.3 | 8 |
1 files changed, 7 insertions, 1 deletions
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 @@ | |||
30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | .\" SUCH DAMAGE. | 31 | .\" SUCH DAMAGE. |
32 | .\" | 32 | .\" |
33 | .\" $OpenBSD: malloc.3,v 1.31 2003/09/26 05:57:02 millert Exp $ | 33 | .\" $OpenBSD: malloc.3,v 1.32 2003/10/16 17:05:04 tedu Exp $ |
34 | .\" | 34 | .\" |
35 | .Dd August 27, 1996 | 35 | .Dd August 27, 1996 |
36 | .Dt MALLOC 3 | 36 | .Dt MALLOC 3 |
@@ -193,6 +193,12 @@ at exit. | |||
193 | This option requires the library to have been compiled with -DMALLOC_STATS in | 193 | This option requires the library to have been compiled with -DMALLOC_STATS in |
194 | order to have any effect. | 194 | order to have any effect. |
195 | .Pp | 195 | .Pp |
196 | .It Cm G | ||
197 | Enable guard pages and chunk randomization. | ||
198 | Each page size or larger allocation is followed by a guard page that will | ||
199 | cause a segmentation fault upon any access. | ||
200 | Smaller than page size chunks are returned in a random order. | ||
201 | .Pp | ||
196 | .It Cm J | 202 | .It Cm J |
197 | .Dq Junk . | 203 | .Dq Junk . |
198 | Fill some junk into the area allocated. | 204 | Fill some junk into the area allocated. |