[lkml]   [2010]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: anonymous mmap() and random heap allocation
Xianghua Xiao writes:
> It seems mmap() can not do random allocation for malloc()/heap on
> Linux, anyone used pax's 'mmap randonness' option for that? what's the
> price for that?
> I want to port openbsd's malloc() to linux to avoid heap
> crashes(overrun/underrun), openbsd's malloc() can do random allocation
> for security reasons, meanwhile it helps to avoid some
> overrun/underrun crashes with no extra cost, the latter is what I'm
> looking for.

You can implement this in user-space with existing kernel features.
1: place guard pages around mmap():ed data
2: parse /proc/self/maps and mmap(MAP_FIXED)
3: use a "safe" compiler or a dynamic binary instrumenter
4: use x86 segments (ugh!)
5: use a safe programming language

 \ /
  Last update: 2010-07-16 12:01    [from the cache]
©2003-2011 Jasper Spaans