On Sun, 18 Oct 2026 at 12:06, Linus Torvalds
<[email protected]> wrote:
>
> That's a separate bug, and you really shouldn't use __get_user to work around
> it just because it doesn't check.
>
> You should use pagefault_disable() around the access. And if there is still a
> sleep_on() complaint, that should be fixed.
Ok, no longer driving around and checked: using pagefault_disable()
around the get_user() should indeed fix the warning, because
get_user() uses 'might_fault()', which doesn't complain if
pagefault_disabled() is set.
Admittedly the actual fault handler uses a different check: it uses
faulthandler_disabled(), which also checks for "in_atomic()", which is
why that __get_user() case just silently happened to work (badly).
But that check is historical - but actively wrong - the added
in_atomic() check in faulthandler_disabled() also checks for disabled
preemption, which is one of those "it's not reliable" things (because
the preemption count depends on whether preemption is enabled at
all!).
So no. There are exactly _zero_ valid reasons to use __get_user() and
friends. We really need to just get rid of that broken garbage. All it
does now is open up potential security holes and allow people to avoid
warnings for actively buggy code.
Linus