lkml.org 
[lkml]   [2020]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: rename probe_kernel_* and probe_user_*
On Wed, Jun 17, 2020 at 11:11 AM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I'm actually a bit surprised that we don't even get a warning for that
> horrible pattern that smells a bit like the gcc 'cast as lvalue'
> thing.

Oh, it's because I once again got confused by the naming.

"get_kernel_nofault()" doesn't have the "get_user()" semantics despite
being written like it. The arguments are in the reverse order, and the
pointer cast is on the address, not the target.

It's more obvious in the code, but not when grepping for things and
being used to the (much MUCH more common) get_user() semantics.

I really think get_kernel_nofault() should reverse the order of
arguments, because right now that "[PATCH 3/3] maccess: rename
probe_kernel_address to get_kernel_nofault" is really really
confusing.

You rename the function to look and act like get_user() (except for
kernel accesses, of course), but you leave it with an argument order
that is very much the reverse of what get_user() has.

So no. I won't be merging this series after all.

Linus

\
 
 \ /
  Last update: 2020-06-17 20:20    [W:0.059 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site