Thread (55 messages) 55 messages, 8 authors, 2017-08-02

Re: [RFC 16/22] x86/percpu: Adapt percpu for PIE support

From: Kees Cook <hidden>
Date: 2017-08-02 16:56:32
Also in: kvm, linux-arch, linux-crypto

On Wed, Aug 2, 2017 at 9:42 AM, Thomas Garnier [off-list ref] wrote:
I noticed that not only we have the problem of gs:0x40 not being
accessible. The compiler will default to the fs register if
mcmodel=kernel is not set.

On the next patch set, I am going to add support for
-mstack-protector-guard=global so a global variable can be used
instead of the segment register. Similar approach than ARM/ARM64.
While this is probably understood, I have to point out that this would
be a major regression for the stack protection on x86.
Following this patch, I will work with gcc and llvm to add
-mstack-protector-reg=<segment register> support similar to PowerPC.
This way we can have gs used even without mcmodel=kernel. Once that's
an option, I can setup the GDT as described in the previous email
(similar to RFG).
It would be much nicer if we could teach gcc about the percpu area
instead. This would let us solve the global stack protector problem on
the other architectures:
http://www.openwall.com/lists/kernel-hardening/2017/06/27/6

-Kees

-- 
Kees Cook
Pixel Security
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help