From: Hubert Tonneau <hubert.tonneau@fullpliant.org>
To: Arjan van de Ven <arjanv@redhat.com>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.12-rc3 mmap lack of consistency among runs
Date: Fri, 29 Apr 2005 14:25:46 GMT [thread overview]
Message-ID: <0563MQZ12@server5.heliogroup.fr> (raw)
Arjan van de Ven wrote:
>
> > You can disable randomization on a per-executable basis by setting an ELF
> > personality. I forget the magic incantation. Arjan?
>
> setarch -R
I had no success with it:
/usr/src/setarch-1.7/setarch i386 -R /pliant/fullpliant
I even tried adding the following instruction at the very beginning of my
C program, with no more success:
personality(0x0040000); // ADDR_NO_RANDOMIZE
Basically, the behaviour is not changed, as opposed to if I do:
echo 0 >/proc/sys/kernel/randomize_va_space
> > . second, my process restart succeeding roughly in 50% cases means that the
> > randomisation performed is just a toy. A virus assuming fixed memory layout
> > will still succeed 50% of times to install.
>
> It just means that half the time the old value was below the current
> boundary, and half the time above. Eg half the time it was in free
> space and you succeeded but left a gap, the other half there was a conflict.
> Says nothing about the value of randomisation...
Understood.
> > All in all, I'm not concerned about Linux kernel to randomise or not,
> > but I need to have a reliable way to request a memory region and be granted
> > that I can request the same one in a futur run.
> > What is the proper way to get such a memory area ?
>
> > MAP_FIXED?
>
> MAP_FIXED is generally a really bad idea though.
If I replace
PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0
with
PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0
the call just fails.
next reply other threads:[~2005-04-29 14:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-29 14:25 Hubert Tonneau [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-04-29 18:36 2.6.12-rc3 mmap lack of consistency among runs Hubert Tonneau
2005-04-29 12:44 Hubert Tonneau
2005-04-29 13:20 ` Andrew Morton
2005-04-29 13:34 ` Arjan van de Ven
2005-04-29 13:29 ` Arjan van de Ven
2005-04-28 9:59 Hubert Tonneau
2005-04-29 12:47 ` Andrew Morton
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=0563MQZ12@server5.heliogroup.fr \
--to=hubert.tonneau@fullpliant.org \
--cc=akpm@osdl.org \
--cc=arjanv@redhat.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