[PATCH] randomized mmap

Marcel Moolenaar marcel at xcllnt.net
Mon May 30 10:21:05 PDT 2005


On May 30, 2005, at 1:46 AM, Robert Watson wrote:

> On a 32-bit system, this sort of change would be disastrous in terms 
> of address space fragmentation, I would think.  However, on a 64-bit 
> system, it might be quite a bit less so.  However, I'm not sure I'd 
> implement it this way: in a 64-bit address space, we may want to do a 
> bit more structuring of the address space and set aside a specific 
> region for mmap's.  Does it make sense to do the randomization only 
> for mappings with the executable bit set, or implicitly set, when 
> talking about 64-bit architectures that have a more reasonable notion 
> of executable than i386?

Executable regions are typically read-only. Read-only regions can share
TLBs across processes if the kernel supports this. Sharing of TLBs can 
be
a performance booster by reducing TLB pressure in certain environments. 
Randomization of executable regions will probably hinder the sharing of
TLBs to such extend that no sharing is possible.

I think the suggestion to do it for executable pages only is not making
things better.  The benefits of randomizing mmap are questionable as it
is, but the implementation is trivial it's not a bother. Keep it simple.
It can be committed if it's simple and off by default. Change the
implementation into something less trivial and the whole thing become a
really bad idea. IMO of course.

-- 
  Marcel Moolenaar         USPA: A-39004          marcel at xcllnt.net



More information about the freebsd-arch mailing list