Re: How to enable/disable security features on mmap() ?

Arjan van de Ven
2005-12-08T14:49:15Z

On Thu, 2005-12-08 at 15:39 +0100, Emmanuel Fleury wrote:
> I guess that setting the variable randomize_va_space to 0 just remove
> the stack pointer (sp) randomization.
>
> Seen in arch/i386/kernel/process.c:
>
> unsigned long arch_align_stack(unsigned long sp)
> {
> if (randomize_va_space)
> sp -= get_random_int() % 8192;
> return sp & ~0xf;
> }
>
> Why not having defined this as a CONFIG_STACK_RANDOMIZATION variables

well it's a /proc/ variable already! So you can just turn it off
entirely at runtime. (what is better is that you use the setarch program
to turn it off for selected programs though...)