Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1527874

Re: [RFC][PATCH] x86: Verify access_ok() context

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH] x86: Verify access_ok() context
Date 2016-11-22 20:40 +0100
Message-ID <sGp58-32O-49@gated-at.bofh.it> (permalink)
References <sGg1Q-5rf-29@gated-at.bofh.it> <sGn3j-1LJ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 22, 2016 at 09:28:01AM -0800, Andy Lutomirski wrote:
> On Tue, Nov 22, 2016 at 1:57 AM, Peter Zijlstra <peterz@infradead.org> wrote:

> > +#define access_ok(type, addr, size)                                    \
> > +({                                                                     \
> > +       WARN_ON_ONCE(!in_task());                                       \
> 
> Should this be guarded by some debug option?  This may hurt
> performance on production systems quite a bit.

I suspected something like that; any suitable CONFIG come to mind? I'm
somewhat reluctant to create yet another one for this.

CONFIG_DEBUG_VM seems somehow inappropriate.

> For what it's worth, I think ARM recently started saving the address
> limit and resetting it to USER_DS on NMI entry.

Up to them of course, but doing less on interrupt entry/exit seems
better.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH] x86: Verify access_ok() context Peter Zijlstra <peterz@infradead.org> - 2016-11-22 11:00 +0100
  Re: [RFC][PATCH] x86: Verify access_ok() context Andy Lutomirski <luto@amacapital.net> - 2016-11-22 18:30 +0100
    Re: [RFC][PATCH] x86: Verify access_ok() context Peter Zijlstra <peterz@infradead.org> - 2016-11-22 20:40 +0100
      Re: [RFC][PATCH] x86: Verify access_ok() context Linus Torvalds <torvalds@linux-foundation.org> - 2016-11-22 20:50 +0100

csiph-web