[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190416160717.GP4038@hirez.programming.kicks-ass.net>
Date: Tue, 16 Apr 2019 18:07:17 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Theodore Ts'o <tytso@....edu>,
David Laight <David.Laight@...LAB.COM>,
"Reshetova, Elena" <elena.reshetova@...el.com>,
Ingo Molnar <mingo@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"luto@...nel.org" <luto@...nel.org>,
"luto@...capital.net" <luto@...capital.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jpoimboe@...hat.com" <jpoimboe@...hat.com>,
"keescook@...omium.org" <keescook@...omium.org>,
"jannh@...gle.com" <jannh@...gle.com>,
"Perla, Enrico" <enrico.perla@...el.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] x86/entry/64: randomize kernel stack offset upon syscall
On Tue, Apr 16, 2019 at 11:43:49AM -0400, Theodore Ts'o wrote:
> If it's x86 specific, maybe the simplest thing to do is to use RDRAND
> if it exists, and fall back to something involving a TSC and maybe
> prandom_u32 (assuming on how bad you think the stack leak is going to
> be) if RDRAND isn't available?
>From https://lkml.kernel.org/r/20190320072715.3857-1-elena.reshetova@intel.com
Performance:
1) lmbench: ./lat_syscall -N 1000000 null
base: Simple syscall: 0.1774 microseconds
random_offset (rdtsc): Simple syscall: 0.1803 microseconds
random_offset (rdrand): Simple syscall: 0.3702 microseconds
2) Andy's tests, misc-tests: ./timing_test_64 10M sys_enosys
base: 10000000 loops in 1.62224s = 162.22 nsec / loop
random_offset (rdtsc): 10000000 loops in 1.64660s = 164.66 nsec / loop
random_offset (rdrand): 10000000 loops in 3.51315s = 351.32 nsec / loop
Basically, RDRAND is frigging slow...
Powered by blists - more mailing lists