Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJcbSZETNhr=Pv+0daEWUsD2=qnZxT9rbmFaE+y7ag-xKOs89w@mail.gmail.com>
Date: Mon, 8 Apr 2019 08:58:54 -0700
From: Thomas Garnier <thgarnie@...omium.org>
To: Christopher Lameter <cl@...ux.com>
Cc: Kernel Hardening <kernel-hardening@...ts.openwall.com>, 
	Kristen Carlson Accardi <kristen@...ux.intel.com>, Andy Lutomirski <luto@...nel.org>, 
	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	"H. Peter Anvin" <hpa@...or.com>, "the arch/x86 maintainers" <x86@...nel.org>, Dennis Zhou <dennis@...nel.org>, 
	Tejun Heo <tj@...nel.org>, Boris Ostrovsky <boris.ostrovsky@...cle.com>, 
	Juergen Gross <jgross@...e.com>, Stefano Stabellini <sstabellini@...nel.org>, 
	Andrew Morton <akpm@...ux-foundation.org>, Andi Kleen <ak@...ux.intel.com>, 
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>, Michal Hocko <mhocko@...e.com>, 
	Mike Rapoport <rppt@...ux.vnet.ibm.com>, Stephen Rothwell <sfr@...b.auug.org.au>, 
	Cao jin <caoj.fnst@...fujitsu.com>, Brijesh Singh <brijesh.singh@....com>, 
	Masahiro Yamada <yamada.masahiro@...ionext.com>, Joerg Roedel <jroedel@...e.de>, 
	Peter Zijlstra <peterz@...radead.org>, Kees Cook <keescook@...omium.org>, 
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, LKML <linux-kernel@...r.kernel.org>, 
	xen-devel <xen-devel@...ts.xenproject.org>
Subject: Re: [PATCH v6 14/27] x86/percpu: Adapt percpu for PIE support

On Fri, Feb 1, 2019 at 9:13 AM Thomas Garnier <thgarnie@...omium.org> wrote:
>
> On Thu, Jan 31, 2019 at 6:31 PM Christopher Lameter <cl@...ux.com> wrote:
> >
> > On Thu, 31 Jan 2019, Thomas Garnier wrote:
> >
> > > The per-cpu symbols are in a section that is zero based to create
> > > offsets. The compiler doesn't see them as offsets but as relative
> > > symbol and try to relocate them. Given the distance between zero and
> > > the mapped kernel is much larger than the instruction offset range, it
> > > fails to do it.
> >
> > We switch that off in the linker. If that does not work with your
> > modifications then you need to figure out how to update the link
> > configuration.
> >
>
> It didn't work originally but I will revisit to see if I missed something.

I revisited and couldn't find a way to prevent relocations to the
percpu section. Without PIE, you can reference absolute address which
was convenient for percpu.

Christopher: Did you have something specific in mind?

I checked the following:
 - Changing the FLAGS() on the PHDRS.
 - using -z noreloc-overflow which actually doesn't seem to apply to
PC32 relocations.
 - Look at all linker options and script format for anything around that.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.