mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH for 2.6.18-rc2] [2/8] i386/x86-64: Don't randomize stack top when no randomization personality
@ 2006-07-17 11:24 Al Boldi
  0 siblings, 0 replies; only message in thread
From: Al Boldi @ 2006-07-17 11:24 UTC (permalink / raw)
  To: linux-kernel

Ingo Molnar wrote:
> * Andi Kleen <ak@suse.de> 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-17 11:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-17 11:24 [PATCH for 2.6.18-rc2] [2/8] i386/x86-64: Don't randomize stack top when no randomization personality Al Boldi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®