Re: [RFC][CFT][PATCHSET v1] uaccess unification

From: Linus Torvalds
Date: Wed Mar 29 2017 - 16:39:39 EST


On Wed, Mar 29, 2017 at 1:29 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> BTW, I wonder if inlining all of the copy_{to,from}_user() is actually a win.

I would suggest against it.

The only part I think is worth inlining is the compile time size
checks for kasan - and that only because of the obvious "sizes are
constant only when inlining" issue.

We used to inline a *lot* of user accesses historically, pretty much
all of them were bogus.

The only ones that really want inlining are the non-checking ones that
people should never use directly, but that are just helper things used
by other routines (ie the "unsafe_copy_from_user()" kind of things
that are designed for strncpy_from_user()).

Once you start checking access ranges, and have might_fault debugging
etc, it shouldn't be inlined.

Linus