lkml.org 
[lkml]   [2017]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC v2][PATCH 04/11] x86: Implement __arch_rare_write_begin/unmap()
On Wed, Mar 29, 2017 at 11:15 AM, Kees Cook <keescook@chromium.org> wrote:
> Based on PaX's x86 pax_{open,close}_kernel() implementation, this
> allows HAVE_ARCH_RARE_WRITE to work on x86.
>

> +
> +static __always_inline unsigned long __arch_rare_write_begin(void)
> +{
> + unsigned long cr0;
> +
> + preempt_disable();

This looks wrong. DEBUG_LOCKS_WARN_ON(!irqs_disabled()) would work,
as would local_irq_disable(). There's no way that just disabling
preemption is enough.

(Also, how does this interact with perf nmis?)

--Andy

\
 
 \ /
  Last update: 2017-03-30 00:39    [W:0.594 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site