[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161028070701.GA11376@gmail.com>
Date: Fri, 28 Oct 2016 09:07:01 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Pavel Machek <pavel@....cz>
Cc: Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
kernel list <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
"kernel-hardening@...ts.openwall.com"
<kernel-hardening@...ts.openwall.com>
Subject: Re: rowhammer protection [was Re: Getting interrupt every million
cache misses]
* Pavel Machek <pavel@....cz> wrote:
> +static void rh_overflow(struct perf_event *event, struct perf_sample_data *data, struct pt_regs *regs)
> +{
> + u64 *ts = this_cpu_ptr(&rh_timestamp); /* this is NMI context */
> + u64 now = ktime_get_mono_fast_ns();
> + s64 delta = now - *ts;
> +
> + *ts = now;
> +
> + /* FIXME msec per usec, reverse logic? */
> + if (delta < 64 * NSEC_PER_MSEC)
> + mdelay(56);
> +}
I'd suggest making the absolute delay sysctl tunable, because 'wait 56 msecs' is
very magic, and do we know it 100% that 56 msecs is what is needed everywhere?
Plus I'd also suggest exposing an 'NMI rowhammer delay count' in /proc/interrupts,
to make it easier to debug this. (Perhaps only show the line if the count is
nonzero.)
Finally, could we please also add a sysctl and Kconfig that allows this feature to
be turned on/off, with the default bootup value determined by the Kconfig value
(i.e. by the distribution)? Similar to CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE.
Thanks,
Ingo
Powered by blists - more mailing lists