From: Al Boldi <a1426z@gawab.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH for 2.6.18-rc2] [2/8] i386/x86-64: Don't randomize stack top when no randomization personality
Date: Mon, 17 Jul 2006 14:24:49 +0300 [thread overview]
Message-ID: <200607171424.49827.a1426z@gawab.com> (raw)
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
reply other threads:[~2006-07-17 11:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200607171424.49827.a1426z@gawab.com \
--to=a1426z@gawab.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®