public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>, Jakub Jelinek <jakub@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kratochvil <honza@jikos.cz>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Ernie Petrides <petrides@redhat.com>
Subject: Re: [PATCH][RESEND] PIE randomization
Date: Thu, 05 Jul 2007 16:57:12 -0400	[thread overview]
Message-ID: <468D5B28.8080308@redhat.com> (raw)
In-Reply-To: <468D5A3A.1010306@redhat.com>

Chuck Ebbert wrote:
> On 07/04/2007 01:35 PM, Jiri Kosina wrote:
>> 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@suse.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.
> 
> But what about this patch that made the opposite change:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ce51059be56f63762089412b3ece348067afda85

Ohhh, interesting.

So the original patch has:

#define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE)

For some reason(?) it got changed to the clearly buggy:

#define BAD_ADDR(x) ((unsigned long)(x) >= PAGE_MASK)

Jiri's patch undoes that second buggy define, which is very
different from the original that was sent in by you and Ernie.

-- 
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is.  Each group
calls the other unpatriotic.

  reply	other threads:[~2007-07-05 20:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-11 12:33 [PATCH][RESEND] PIE randomization Jan Kratochvil
2007-05-11 19:56 ` Andrew Morton
2007-05-11 20:18   ` Jiri Kosina
2007-05-11 20:36     ` Andrew Morton
2007-05-11 22:41       ` Ulrich Drepper
2007-05-11 23:50       ` Jiri Kosina
2007-05-16 17:14         ` Jiri Kosina
2007-05-17 20:24           ` Jan Kratochvil
2007-05-17 21:50             ` Jiri Kosina
2007-05-18 17:29             ` Andrew Morton
2007-05-21 14:58             ` Hugh Dickins
2007-05-22 23:16             ` Andrew Morton
2007-05-23  8:50               ` Jiri Kosina
2007-07-04  8:25                 ` Jakub Jelinek
2007-07-04 17:35                   ` Jiri Kosina
2007-07-05 20:53                     ` Chuck Ebbert
2007-07-05 20:57                       ` Rik van Riel [this message]
2007-07-07  0:13                         ` Jiri Kosina
2007-07-07 12:30                           ` Jakub Jelinek
2007-07-09 11:41                             ` Jiri Kosina
2007-07-09 21:58                               ` Jiri Kosina
2007-07-10  9:47                                 ` Jakub Jelinek
2007-07-11  9:58                                   ` 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=468D5B28.8080308@redhat.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=honza@jikos.cz \
    --cc=jakub@redhat.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=petrides@redhat.com \
    /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