Re: [RFC][PATCH 5/7] x86: convert arch_futex_atomic_op_inuser() to user_access_begin/user_access_end()

From: Linus Torvalds
Date: Mon Mar 23 2020 - 15:07:03 EST


On Mon, Mar 23, 2020 at 11:53 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
>
> Lift stac/clac pairs from __futex_atomic_op{1,2} into arch_futex_atomic_op_inuser(),
> fold them with access_ok() in there.

So this is a deep internal macro and already has the double
underscore, but I'm inclined to say "add the unsafe here too" for
those __futex_atomic_opX() macros that are now called inside that
user_access_begin/end region.

And wouldn't it be lovely to get rid of the error return thing, and
pass in a label instead, the way "usafe_get/put_user()" works too?
That might be a separate patch from the "reorg" thing, though.

Linus