Re: [PATCH for 2.6.18-rc2] [2/8] i386/x86-64: Don't randomize stack top when no randomization personality

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ingo Molnar wrote:
> * Andi Kleen <[email protected]> wrote:
> >  unsigned long arch_align_stack(unsigned long sp)
> >  {
> > -     if (randomize_va_space)
> > +     if (!(current->personality & ADDR_NO_RANDOMIZE) &&
> > randomize_va_space) sp -= get_random_int() % 8192;
> >       return sp & ~0xf;
>
> i'm not opposing this patch at all, but didnt the performance problems
> go away when the 0xf was changed to 0x7f?

Yes, 0x7f is critical, but I'm not sure about side-effects.

> looks good otherwise.

except this one

> --- linux.orig/fs/binfmt_elf.c
> +++ linux/fs/binfmt_elf.c
> @@ -515,7 +515,8 @@ static unsigned long randomize_stack_top
>  {
>         unsigned int random_variable = 0;
>
> -       if (current->flags & PF_RANDOMIZE) {
> +       if ((current->flags & PF_RANDOMIZE) &&
> +               !(current->personality & ADDR_NO_RANDOMIZE)) {
>                 random_variable = get_random_int() & STACK_RND_MASK;
>                 random_variable <<= PAGE_SHIFT;
>         }

Why are you testing twice?

Thanks!

--
Al

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux