From: Pavel Machek <pavel@ucw.cz>
To: Jiri Kosina <jkosina@suse.cz>
Cc: kernel list <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>,
Abel Bernabeu <abel.bernabeu@gmail.com>,
Hugh Dickins <hugh@veritas.com>,
Arjan van de Ven <arjan@infradead.org>
Subject: Re: brk randomization breaks columns
Date: Tue, 5 Feb 2008 17:02:14 +0100 [thread overview]
Message-ID: <20080205160214.GD24331@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.64.0802050242440.30873@twin.jikos.cz>
Hi!
> Still, it will probably not fix your particular program crashes, just
> because it will always assume that brk starts immediately after the end of
> the bss, which is plain wrong and has never been assured. Could you please
> check whether there is any compat-* package available for you
> distribution, that upgrades libc.so.5 to any fixed version?
I got libc.so.5 as a binary from some Slackware-based system, IIRC,
and I can't find any relevant compat-* packages :-(.
> From: Jiri Kosina <jkosina@suse.cz>
>
> brk: check the lower bound properly
>
> There is a check in sys_brk(), that tries to make sure that we do not
> underflow the area that is dedicated to brk heap.
>
> The check is however wrong, as it assumes that brk area starts immediately
> after the end of the code (+bss), which is wrong for example in
> environments with randomized brk start. The proper way is to check whether
> the address is not below the start_brk address.
>
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ACK.
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 8295577..1c3b48f 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -241,7 +241,7 @@ asmlinkage unsigned long sys_brk(unsigned long brk)
>
> down_write(&mm->mmap_sem);
>
> - if (brk < mm->end_code)
> + if (brk < mm->start_brk)
> goto out;
>
> /*
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2008-02-05 16:03 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-04 12:28 brk randomization breaks columns Pavel Machek
2008-02-04 13:01 ` Ingo Molnar
2008-02-04 13:28 ` Pavel Machek
2008-02-04 14:55 ` Jiri Kosina
2008-02-04 20:25 ` Pavel Machek
2008-02-04 14:33 ` Jiri Kosina
2008-02-04 16:12 ` Jiri Kosina
[not found] ` <15577be70802041016m97cddbfk43b9073408bcbce9@mail.gmail.com>
[not found] ` <15577be70802041029o2975ba6do34589bbdc81d1652@mail.gmail.com>
2008-02-04 19:52 ` Fwd: " Pavel Machek
2008-02-04 21:54 ` Abel Bernabeu
2008-02-04 22:48 ` Jiri Kosina
2008-02-04 23:13 ` Abel Bernabeu
2008-02-04 23:39 ` Pavel Machek
2008-02-04 20:31 ` Pavel Machek
2008-02-05 1:57 ` Jiri Kosina
2008-02-05 11:06 ` [regression] " Pavel Machek
2008-02-05 12:50 ` Jiri Kosina
2008-02-05 12:54 ` Ingo Molnar
2008-02-05 13:05 ` Jakub Jelinek
2008-02-05 16:18 ` Pavel Machek
2008-02-05 16:37 ` Ingo Molnar
2008-02-05 16:12 ` Pavel Machek
2008-02-05 13:08 ` Hugh Dickins
2008-02-05 15:00 ` Arjan van de Ven
2008-02-05 15:46 ` Pavel Machek
2008-02-05 15:49 ` Jiri Kosina
2008-02-05 15:55 ` Pavel Machek
2008-02-05 15:49 ` Ingo Molnar
2008-02-05 15:59 ` Pavel Machek
2008-02-05 16:06 ` Ingo Molnar
2008-02-05 22:03 ` Pavel Machek
2008-02-05 16:58 ` Arjan van de Ven
2008-02-05 17:33 ` Pavel Machek
2008-02-05 22:35 ` Jiri Kosina
2008-02-06 3:24 ` Randy Dunlap
2008-02-05 16:02 ` Pavel Machek [this message]
2008-02-05 16:09 ` Ingo Molnar
2008-02-05 22:04 ` Pavel Machek
2008-02-05 18:05 ` Pavel Machek
2008-02-05 20:42 ` Jiri Kosina
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=20080205160214.GD24331@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=abel.bernabeu@gmail.com \
--cc=arjan@infradead.org \
--cc=hugh@veritas.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.