mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Sami Farin <safari-kernel@safari.iki.fi>
Cc: Linux kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jiri Kosina <jkosina@suse.cz>
Subject: Re: x86: randomize brk() and RLIMIT_DATA
Date: Thu, 25 Oct 2007 07:13:24 -0700	[thread overview]
Message-ID: <20071025071324.2eac21d6@laptopd505.fenrus.org> (raw)
In-Reply-To: <20071025134124.wc44gdud7ixghfxv@m.safari.iki.fi>

On Thu, 25 Oct 2007 16:41:24 +0300
Sami Farin <safari-kernel@safari.iki.fi> wrote:

> Would be neat if randomized brk and setrlimit(RLIMIT_DATA, ...)
> worked in a predictable way:

this isn't a valid case afaics; even on "traditional x86" (before we
changed the address space layout, or even today if you have an
unlimited stack rlimit) this isn't going to work. applications really
shouldn't use (s)brk() but malloc(); you have to be able to fall back
to mmap regardless of what you do.

> 
> $ gcc brk.c -fPIC -pie -m64;./a.out;./a.out;./a.out
> sbrk=0x7f721b815000 main=0x7f721af04860
> sbrk succeeded (brk=0x7f721b909240)
> sbrk=0x7fc3d77e2000 main=0x7fc3d66fa860
> sbrk failed: Cannot allocate memory (brk=0x7fc3d77e2000)
> sbrk=0x7f05b0615000 main=0x7f05af76b860
> sbrk failed: Cannot allocate memory (brk=0x7f05b0615000)
> 


-- 
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2007-10-25 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25 13:41 Sami Farin
2007-10-25 14:13 ` Arjan van de Ven [this message]
2007-10-25 14:46   ` Jiri Kosina
2007-10-25 17:19     ` Sami Farin
2007-10-26 10:44       ` [PATCH] [RFC] brk randomization: compute RLIMIT_DATA properly (was Re: x86: randomize brk() and RLIMIT_DATA) Jiri Kosina
2007-10-26 12:02         ` Hugh Dickins
2007-10-26 12:16           ` Jiri Kosina
2007-10-26 12:30             ` Hugh Dickins
2007-10-26 12:33               ` Jan Engelhardt
2007-10-26 13:24                 ` Hugh Dickins

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=20071025071324.2eac21d6@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=safari-kernel@safari.iki.fi \
    /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®