Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Aug 1997 14:18:26 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        phk@dk.tfs.com (Poul-Henning Kamp)
Cc:        wpaul@skynet.ctr.columbia.edu, andreas@klemm.gtn.com, current@FreeBSD.ORG
Subject:   Re: httpd in free(): warning: modified (page-) pointer.
Message-ID:  <199708082118.OAA29053@phaeton.artisoft.com>
In-Reply-To: <26184.871052158@critter.dk.tfs.com> from "Poul-Henning Kamp" at Aug 8, 97 04:55:58 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> >	o Electric Fence works by using mmap() to allocate memory instead
> >	  of brk()/sbrk(). To trap out of bounds references, it allocates
> >	  an extra page of memory immediately after the memory requested
> >	  with malloc()/calloc()/etc and uses mprotect() to disallow
> >	  read and write access to it.
> 
> This is why a similar feature hasn't been implemented into phkmalloc
> yet, it would only give page size granularity, ie, you have to overrun
> by a LOT before you can figure it out, I tried it, and it didn't find
> one single problem in the two months I ran with it so I ditched it.

It would be hard to underruns without a whole lot of code, but
overrruns (the most common case anyway, IMO) could be handled by
allocating the memory and returning the pointer so the end is
on the page boundry (followed by an unmapped page).

This would actually be pretty trivial to do, I think.

The real problem, I suppose, is that you would not want the code
active all the time (sort of implied by where you tried this?).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708082118.OAA29053>