[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200329181627.GD23230@ZenIV.linux.org.uk>
Date: Sun, 29 Mar 2020 19:16:27 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Laight <David.Laight@...lab.com>,
Andy Lutomirski <luto@...capital.net>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Borislav Petkov <bp@...en8.de>
Subject: Re: [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;
Powered by blists - more mailing lists