linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Boldi <a1426z@gawab.com>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Frank van Maarseveen <frankvm@frankvm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>, Andi Kleen <ak@suse.de>
Subject: Re: [PATCH] x86: Don't randomize stack unless current->personality permits it
Date: Sun, 16 Jul 2006 22:49:25 +0300	[thread overview]
Message-ID: <200607162249.25641.a1426z@gawab.com> (raw)
In-Reply-To: <200607160000_MC3-1-C51D-6B44@compuserve.com>

Chuck Ebbert wrote:
> On Sat, 15 Jul 2006 17:09:45 +0300, Al Boldi wrote:
> > Randomization on.  Executable runs with 8x blips/hits.
> > Randomization off.  Executable runs without blips/hits.
> > With randomization off, a mere rename causes an 8x-slowdown to occur. 
> > Run this renamed executable through sh -c ./tstExec, and the slowdown
> > disappears.  Really weired :)
>
> Does this help at all?  I don't have a space heater^W^WPentium IV
> to test on.

P4 is not a space heater, it's a stove.

> --- 2.6.18-rc1-nb.orig/arch/i386/kernel/process.c
> +++ 2.6.18-rc1-nb/arch/i386/kernel/process.c
> @@ -890,5 +890,5 @@ unsigned long arch_align_stack(unsigned
>  {
>  	if (randomize_va_space)
>  		sp -= get_random_int() % 8192;
> -	return sp & ~0xf;
> +	return sp & ~0x7f;
>  }

Thanks! That did the trick!

The weirdness is completely gone, as are the continuous slowdowns, but I 
still get these:

on mdk9.1/gcc3.2.2/2.6.17.4
# gcc -O3 tstExec.c
# echo 0 > /proc/sys/kernel/randomize_va_space
# while :; do ./a.out;done

   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5   13    5    6    5 msec
   5    5    5    5    5    5    7    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5   13    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    6 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5   13    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec
   5    5    5    5    5    5    5    5    6    5 msec

on mdk9.1/gcc3.2.2/2.6.17.4
# gcc -O3 tstExec.c
# echo 1 > /proc/sys/kernel/randomize_va_space
# while :; do ./a.out;done

   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    6    5    5   13    5   13    5 msec
   5    5    5    5    5    5   13    5    6    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5   11    5   13    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    6    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5   13    5    6    5 msec
   5    5    5    5    5    5    6    5   13    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5   13    5    6    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5    6    5   13    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5    6    5   13    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5   13    5    6    5 msec
   5    5    5    5    5    5   13    5    7    5 msec
   5    5    5    5    5    5   13    5   13    5 msec
   5    5    5    5    5    5    6    5    6    5 msec
   5    5    5    5    5    5    6    5    6    5 msec

on rhel4/gcc4.0.1/2.6.17.4
# gcc -O3 tstExec.c
# echo 0 > /proc/sys/kernel/randomize_va_space
# while :; do ./a.out;done

   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   6    6    6    6    6    6    6    6    6    6 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    6    5    5    5    5    5    5    5    5 msec

on rhel4/gcc4.0.1/2.6.17.4
# gcc -O3 tstExec.c
# echo 1 > /proc/sys/kernel/randomize_va_space
# while :; do ./a.out;done

  13   13   13   13   13   13   13   13   13   13 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   12    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
  13   13   13   13   13   13   13   13   13   13 msec
  13   13   13   13   13   13   13   13   13   14 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   14 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec
   5    5    5    5    5    5    5    5    5    5 msec
  13   13   13   13   13   13   13   13   13   13 msec

Thanks again!

--
Al



  reply	other threads:[~2006-07-16 19:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-16  3:58 [PATCH] x86: Don't randomize stack unless current->personality permits it Chuck Ebbert
2006-07-16 19:49 ` Al Boldi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-07-25  0:21 Chuck Ebbert
2006-07-25  4:57 ` Al Boldi
2006-07-19 17:02 Chuck Ebbert
2006-07-20 17:23 ` Al Boldi
2006-07-24 15:57   ` Al Boldi
2006-07-11 19:57 Al Boldi
2006-07-12 16:03 ` Andi Kleen
2006-07-12 20:12   ` Al Boldi
2006-07-12 20:27     ` Arjan van de Ven
2006-07-12 21:13       ` Al Boldi
2006-07-13  9:44   ` Frank van Maarseveen
2006-07-13 20:51     ` Al Boldi
2006-07-13 20:54       ` Arjan van de Ven
2006-07-15 11:29         ` Al Boldi
2006-07-15 12:22           ` Arjan van de Ven
2006-07-15 14:09             ` Al Boldi
2006-07-15 16:15               ` Arjan van de Ven
2006-07-15 17:39               ` Al Boldi
2006-07-17 15:50               ` Paulo Marques
2006-07-18  5:21                 ` Al Boldi
2006-07-11 15:22 Frank van Maarseveen
2006-07-11 20:11 ` Arjan van de Ven

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=200607162249.25641.a1426z@gawab.com \
    --to=a1426z@gawab.com \
    --cc=76306.1226@compuserve.com \
    --cc=ak@suse.de \
    --cc=arjan@infradead.org \
    --cc=frankvm@frankvm.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;
as well as URLs for NNTP newsgroup(s).