RE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-29 Thread Reshetova, Elena
> On Thu, Mar 28, 2019 at 9:29 AM Andy Lutomirski wrote: > > Doesn’t this just leak some of the canary to user code through side > > channels? > > Erf, yes, good point. Let's just use prandom and be done with it. And here I have some numbers on this. Actually prandom turned out to be pretty

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-28 Thread Kees Cook
On Thu, Mar 28, 2019 at 9:29 AM Andy Lutomirski wrote: > Doesn’t this just leak some of the canary to user code through side channels? Erf, yes, good point. Let's just use prandom and be done with it. -- Kees Cook

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-28 Thread Andy Lutomirski
> On Mar 28, 2019, at 8:45 AM, Kees Cook wrote: > >> On Tue, Mar 26, 2019 at 9:31 PM Andy Lutomirski wrote: >> >> On Tue, Mar 26, 2019 at 3:35 AM Reshetova, Elena >> wrote: >>> > On Mon, Mar 18, 2019 at 1:16 PM Andy Lutomirski wrote: > On Mon, Mar 18, 2019 at 2:41 AM Elena

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-28 Thread Kees Cook
On Tue, Mar 26, 2019 at 9:31 PM Andy Lutomirski wrote: > > On Tue, Mar 26, 2019 at 3:35 AM Reshetova, Elena > wrote: > > > > > On Mon, Mar 18, 2019 at 1:16 PM Andy Lutomirski wrote: > > > > On Mon, Mar 18, 2019 at 2:41 AM Elena Reshetova > > > > wrote: > > > > > Performance: > > > > > > > > >

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-26 Thread Andy Lutomirski
On Tue, Mar 26, 2019 at 3:35 AM Reshetova, Elena wrote: > > > On Mon, Mar 18, 2019 at 1:16 PM Andy Lutomirski wrote: > > > On Mon, Mar 18, 2019 at 2:41 AM Elena Reshetova > > > wrote: > > > > Performance: > > > > > > > > 1) lmbench: ./lat_syscall -N 100 null > > > > base:

RE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-26 Thread Reshetova, Elena
> On Mon, Mar 18, 2019 at 1:16 PM Andy Lutomirski wrote: > > On Mon, Mar 18, 2019 at 2:41 AM Elena Reshetova > > wrote: > > > Performance: > > > > > > 1) lmbench: ./lat_syscall -N 100 null > > > base: Simple syscall: 0.1774 microseconds > > > random_offset

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-20 Thread Andy Lutomirski
> On Mar 20, 2019, at 4:12 AM, David Laight wrote: > > 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

RE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-20 Thread Reshetova, Elena
> On Mon, Mar 18, 2019 at 01:15:44PM -0700, Andy Lutomirski wrote: > > On Mon, Mar 18, 2019 at 2:41 AM Elena Reshetova > > wrote: > > > > > > If CONFIG_RANDOMIZE_KSTACK_OFFSET is selected, > > > the kernel stack offset is randomized upon each > > > entry to a system call after fixed location of

RE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-20 Thread Reshetova, Elena
Smth is really weird with my intel mail: it only now delivered me all messages in one go and I was thinking that I don't get any feedback... > > If CONFIG_RANDOMIZE_KSTACK_OFFSET is selected, > > the kernel stack offset is randomized upon each > > entry to a system call after fixed location of

RE: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-20 Thread David Laight
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

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-18 Thread Josh Poimboeuf
On Mon, Mar 18, 2019 at 01:15:44PM -0700, Andy Lutomirski wrote: > On Mon, Mar 18, 2019 at 2:41 AM Elena Reshetova > wrote: > > > > If CONFIG_RANDOMIZE_KSTACK_OFFSET is selected, > > the kernel stack offset is randomized upon each > > entry to a system call after fixed location of pt_regs > >

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-18 Thread Kees Cook
On Mon, Mar 18, 2019 at 1:16 PM Andy Lutomirski wrote: > On Mon, Mar 18, 2019 at 2:41 AM Elena Reshetova > wrote: > > Performance: > > > > 1) lmbench: ./lat_syscall -N 100 null > > base: Simple syscall: 0.1774 microseconds > > random_offset (rdtsc): Simple

Re: [RFC PATCH] x86/entry/64: randomize kernel stack offset upon syscall

2019-03-18 Thread Andy Lutomirski
On Mon, Mar 18, 2019 at 2:41 AM Elena Reshetova wrote: > > If CONFIG_RANDOMIZE_KSTACK_OFFSET is selected, > the kernel stack offset is randomized upon each > entry to a system call after fixed location of pt_regs > struct. > > This feature is based on the original idea from > the PaX's RANDKSTACK