lkml.org 
[lkml]   [2013]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] binfmt_elf: fix PIE load with randomization disabled
On Mon, 9 Dec 2013, H.J. Lu wrote:

> Normally, a PIE executable has zero virtual address on the first PT_LOAD
> segment and kernel will load such executable at random address when
> randomization is enabled. If randomization is disabled, kernel will load
> it at a fixed address. But if a PIE executable has non-zero virtual
> address on the first PT_LOAD segment, kernel will load such executable
> at the non-zero virtual address when randomization is enabled. But when
> randomization is disabled, kernel ignores the non-zero virtual address
> at the non-zero virtual address when randomization is enabled.

Hmm ... isn't actually this the thing that needs to be fixed instead?

IOW, when randomization is enabled, is there a reason not to load on
randomized address? (even if the first PT_LOAD segment has non-zero
vaddr?)

> But when randomization is disabled, kernel ignores the non-zero virtual
> address on the first PT_LOAD segment and loads it at the fixed address.
> This patch makes kernel consistent by loading PIE executable with
> non-zero virtual address at the non-zero virtual address, regardless if
> randomization is enabled or disabled.

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2013-12-09 22:21    [W:0.069 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site