lkml.org 
[lkml]   [2019]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall
Date
From: Andy Lutomirski
> Sent: 18 March 2019 20:16
...
> > As a result this patch introduces 8 bits of randomness
> > (bits 4 - 11 are randomized, bits 0-3 must be zero due to stack alignment)
> > after pt_regs location on the thread stack.
> > The amount of randomness can be adjusted based on how much of the
> > stack space we wish/can trade for security.
>
> Why do you need four zero bits at the bottom? x86_64 Linux only
> maintains 8 byte stack alignment.

ISTR that the gcc developers arbitrarily changed the alignment
a few years ago.
If the stack is only 8 byte aligned and you allocate a variable that
requires 16 byte alignment you need gcc to generate the extra stack
frame to align the stack.
I don't remember seeing the relevant gcc options on the linux
gcc command lines.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2019-03-20 12:12    [W:0.133 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site