lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86: Only do a single page fault for copy_from_user_nmi
> There are cleaner ways to solve this problem - PeterZ offered 
> one, but there are other options as well, such as:
>
> - removing exact-bytes semantics explicitly from almost all
> cases and offering a separate (and more expensive, in the
> faulting case) memcpy variant for write() and other code that
> absolutely must know the number of copied bytes.

That would be a full tree audit of thousands of calls.
And any mistake would be a security hole.

> - or adding a special no-bytes-copied memcpy variant that the
> NMI code could use.

That's the duplicated copy path I mentioned. If people really want that
I can implement it, although I personally think it's ugly and bloated
over engineering for this case.

> It might be more work for you, but it gives us a cleaner and more
> maintainable kernel. The problem is that you should know this
> general principle already, instead you are wasting maintainer
> bandwidth via arguing in favor of ugly hacks again and again...

The duplicated path is unlikely to be more maintainable
than the simple and obvious check.

-Andi


\
 
 \ /
  Last update: 2014-10-04 02:01    [W:0.062 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site