Re: malloc canaries and validation

2015-12-06 Thread Daniel Micay
On Sun, 2015-12-06 at 17:10 -0700, Theo de Raadt wrote: > Kept out of circulation?  It sounds like it would be incredibly > expensive data-structure wise for the kernel to even attempt such a > gaurantee.. I was just expecting it to be a FIFO ring buffer. It would have a limit on the number of map

Re: malloc canaries and validation

2015-12-06 Thread Theo de Raadt
> It would also be interesting to try out a more aggressive form of > freeunmap for 64-bit where the allocations are purged with MADV_FREE > and then the virtual memory is kept out of circulation with a similar > FIFO queue approach. Could potentially do it by default when malloc > hints are enable

Re: malloc canaries and validation

2015-12-06 Thread Daniel Micay
It would also be interesting to try out a more aggressive form of freeunmap for 64-bit where the allocations are purged with MADV_FREE and then the virtual memory is kept out of circulation with a similar FIFO queue approach. Could potentially do it by default when malloc hints are enabled, so it w

Re: malloc canaries and validation

2015-12-06 Thread Daniel Micay
It would be great to land this simple initial implementation and move from there. I have ideas on how to make these features better but I'm wary of doing a lot of work out-of-tree. If it lands in some form, that would go a long way to encouraging further work on it. I basically just don't want to e

Re: malloc canaries and validation

2015-12-05 Thread Theo Buehler
On Wed, Dec 02, 2015 at 08:37:05AM -0500, Ted Unangst wrote: > This is a variant of the diffs sent by Daniel Micay, and then assembled by > Theo Buehler. I've looked it over and made a few tweaks. > > One: validate the junk in malloc hasn't been touched. I've tweaked this to > always be on if junk

malloc canaries and validation

2015-12-02 Thread Ted Unangst
This is a variant of the diffs sent by Daniel Micay, and then assembled by Theo Buehler. I've looked it over and made a few tweaks. One: validate the junk in malloc hasn't been touched. I've tweaked this to always be on if junk is on, but to only check the first 32 bytes. (Without the atexit() han