lkml.org 
[lkml]   [2020]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 01/22] x86 user stack frame reads: switch to explicit __get_user()
On Sun, Mar 29, 2020 at 10:56:59AM -0700, Linus Torvalds wrote:

> But, if you have lots of performance-critical get_user() calls, just use
>
> if (user_access_begin(..))
> goto efault;
>
> .. multiple "unsafe_get_user(x,ptr,efault);" ..
>
> user_access_end();
> ...
>
> efault:
> user_access_end();
> return -EFAULT;
>
> and be done with it.

Except that you'd better make that
if (!user_access_begin(...))
return -EFAULT;

\
 
 \ /
  Last update: 2020-03-29 20:19    [W:0.113 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site