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

2019-04-16 Thread Ingo Molnar
* Andy Lutomirski wrote: > On Wed, Apr 10, 2019 at 4:43 AM Ingo Molnar wrote: > > > > > > * Elena Reshetova wrote: > > > > > 2) Andy's tests, misc-tests: ./timing_test_64 10M sys_enosys > > > base:1000 loops in > > > 1.62224s = 162.22 nsec / l

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

2019-04-10 Thread Kees Cook
On Wed, Apr 10, 2019 at 7:49 AM Andy Lutomirski wrote: > And build it like this, it fails: > > $ gcc -o ingo -g ingo.c -pie > /usr/bin/ld: /tmp/ccofYU9N.o: relocation R_X86_64_32 against `.rodata' > can not be used when making a PIE object; recompile with -fPIC > /usr/bin/ld: final link failed: no

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

2019-04-10 Thread Andy Lutomirski
On Wed, Apr 10, 2019 at 4:43 AM Ingo Molnar wrote: > > > * Elena Reshetova wrote: > > > 2) Andy's tests, misc-tests: ./timing_test_64 10M sys_enosys > > base:1000 loops in 1.62224s > > = 162.22 nsec / loop > > random_offset (prandom_u32() ever

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

2019-04-10 Thread Reshetova, Elena
> * Elena Reshetova wrote: > > > 2) Andy's tests, misc-tests: ./timing_test_64 10M sys_enosys > > base:1000 loops in 1.62224s > > = 162.22 nsec / loop > > random_offset (prandom_u32() every syscall): 1000 loops in 1.64660s > > = > 166.2

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

2019-04-10 Thread Ingo Molnar
* Elena Reshetova wrote: > 2) Andy's tests, misc-tests: ./timing_test_64 10M sys_enosys > base:1000 loops in 1.62224s = > 162.22 nsec / loop > random_offset (prandom_u32() every syscall): 1000 loops in 1.64660s = > 166.26 nsec / loop S

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

2019-04-10 Thread Elena Reshetova
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 feature: https://pax.grsecurity.net/docs/randkstack.txt All the credits