mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	Josh Boyer <jwboyer@redhat.com>
Subject: Re: [PATCH] binfmt_elf: fix PIE load with randomization disabled
Date: Mon, 09 Dec 2013 15:35:32 -0800	[thread overview]
Message-ID: <52A653C4.1050208@zytor.com> (raw)
In-Reply-To: <CAMe9rOpuFzqA7tOGZ3Eh8Vb76+Y5T2xirAfB08NHbSS5R-OjuQ@mail.gmail.com>

On 12/09/2013 01:44 PM, H.J. Lu wrote:
> On Mon, Dec 9, 2013 at 1:39 PM, H. Peter Anvin <hpa@zytor.com> wrote:
>> On 12/09/2013 01:03 PM, H.J. Lu wrote:
>>>
>>> No, please don't do that.  Normally, PIE has zero load address and kernel
>>> can load it anywhere.  There are multiple reasons why PIE has non-zero
>>> load address.  Saying you need to load a program above 4GB under x86-64,
>>> you can't do that with normal dynamic executable.  PIE with non-zero load
>>> address is the only way to do that on x86-64.
>>>
>>
>> Why does it have to be PIE?
>>
> 
> x86-64 small model is limited to 4GB in size.  You can't build
> a dynamic executable in small model larger than 4GB.
> 
> There are medium and large models.  But they are slower than
> small models as well as small models in PIE.  Also there are
> no glibc run-times for medium and large models.
> 

Compiling for the small PIC model shouldn't automatically mean
generating a PIE (ET_DYN) executable, though (and if those are
inherently linked, that is a fundamental bug IMNSHO.)

	-hpa


  reply	other threads:[~2013-12-09 23:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09 15:50 H.J. Lu
2013-12-09 20:57 ` Jiri Kosina
2013-12-09 21:03   ` H.J. Lu
2013-12-09 21:13     ` Jiri Kosina
2013-12-09 21:47       ` H.J. Lu
2013-12-09 21:49         ` H. Peter Anvin
2013-12-09 21:52           ` H.J. Lu
2013-12-09 21:53             ` H. Peter Anvin
2013-12-09 21:59               ` H.J. Lu
2013-12-09 22:01                 ` H. Peter Anvin
2013-12-09 22:03                   ` H.J. Lu
2013-12-11 13:36                     ` Jiri Kosina
2013-12-11 13:41                       ` H.J. Lu
2013-12-11 17:49                         ` H. Peter Anvin
2013-12-11 18:21                           ` H.J. Lu
2013-12-11 19:43                             ` H. Peter Anvin
2013-12-11 20:02                               ` H.J. Lu
2013-12-09 21:51         ` Jiri Kosina
2013-12-09 21:39     ` H. Peter Anvin
2013-12-09 21:44       ` H.J. Lu
2013-12-09 23:35         ` H. Peter Anvin [this message]
2013-12-09 23:53           ` H.J. Lu
2013-12-10  0:37             ` H. Peter Anvin
2013-12-10  0:41               ` H.J. Lu

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=52A653C4.1050208@zytor.com \
    --to=hpa@zytor.com \
    --cc=hjl.tools@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=jwboyer@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

all inboxes | Powered by JetHome®