Alright, trying again. This patch is a bit smaller, easier to read, more streamline. randomize_stack_top() had code pulled out and put into a static inline just before it; and the mmap() randomization calculations are in fs/exec.c now. arch_align_stack() should also work on stack-grows-up architectures like HPPA, not that it'll be used there right now. I am considering the following changes: - Base randomization on ranges, as suggested by Arjan van de Ven. That supersets current functionality, and we can implement entropy in bits abstractly anyway (i.e. range = PAGE_SIZE * powr(2,ENTROPY_IN_BITS)). - Remove validation like 'if (random_bits > MAX_RANDOM_STACK_BITS)'. These are not immediately useful; if SELinux hooks are added or such, they would be, but they could also be added into the SELinux code for those policy elements anyway. - Remove /*XXX: Put SELinux hooks here*/ comments. This isn't hard to figure out, anyone who wants to add SELinux hooks can figure this out then. So before doing that, here's the current version. Again, this has not yet been compile tested, it's just scribbled out on paper. Questions? Comments? Flames? Pictures of your girlfriends? -- All content of all messages exchanged herein are left in the Public Domain, unless otherwise explicitly stated. Creative brains are a valuable, limited resource. They shouldn't be wasted on re-inventing the wheel when there are so many fascinating new problems waiting out there. -- Eric Steven Raymond We will enslave their women, eat their children and rape their cattle! -- Bosc, Evil alien overlord from the fifth dimension