[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0707041927090.11634@jikos.suse.cz>
Date: Wed, 4 Jul 2007 19:35:17 +0200 (CEST)
From: Jiri Kosina <jkosina@...e.cz>
To: Jakub Jelinek <jakub@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Jan Kratochvil <honza@...os.cz>, Ingo Molnar <mingo@...e.hu>,
Rik van Riel <riel@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][RESEND] PIE randomization
On Wed, 4 Jul 2007, Jakub Jelinek wrote:
> The above highlighted changes are the cause of random segfaults of PIE
> binaries. See
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246623
Thanks a lot for pointing this out. Andrew, could this be folded into
pie-randomization.patch please?
From: Jiri Kosina <jkosina@...e.cz>
pie randomization: fix BAD_ADDR macro
pie-randomization.patch makes the load_addr in load_elf_interp() the load
bias of ld.so (difference between the actual load base address and first
PT_LOAD segment's p_vaddr). If the difference equals (on x86) to
0xfffff000 (which is valid [1]), SIGSEGV is incorrectly sent.
This patch changes the BAD_ADDR so that it catches the mappings to the
error-area properly.
[1] https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246623
Reported-by: Jakub Jelinek <jakub@...hat.com>
Signed-off-by: Jiri Kosina <jkosina@...e.cz>
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index da270d1..466477d 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -80,7 +80,7 @@ static struct linux_binfmt elf_format = {
.hasvdso = 1
};
-#define BAD_ADDR(x) ((unsigned long)(x) >= PAGE_MASK)
+#define BAD_ADDR(x) IS_ERR_VALUE(x)
static int set_brk(unsigned long start, unsigned long end)
{
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists