Re: [PATCH] Convert filldir() from __put_user() to unsafe_put_user()
From: Linus Torvalds
Date: Sun Oct 13 2019 - 16:21:05 EST
On Sun, Oct 13, 2019 at 12:59 PM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> Re plotting: how strongly would you object against passing the range to
> user_access_end()? Powerpc folks have a very close analogue of stac/clac,
> currently buried inside their __get_user()/__put_user()/etc. - the same
> places where x86 does, including futex.h and friends.
> And there it's even costlier than on x86. It would obviously be nice
> to lift it at least out of unsafe_get_user()/unsafe_put_user() and
> move into user_access_begin()/user_access_end(); unfortunately, in
> one subarchitecture they really want it the range on the user_access_end()
> side as well.
Hmm. I'm ok with that.
Do they want the actual range, or would it prefer some kind of opaque
cookie that user_access_begin() returns (where 0 would mean "failure"
I'm thinking like a local_irq_save/restore thing, which might be the
case on yet other architectures.