On Wed, Dec 2, 2026 at 8:02 AM Arnd Bergmann <[email protected]> wrote:
>
> On Wed, Dec 2, 2026, at 05:07, Alexei Starovoitov wrote:
> > On Tue, Dec 01, 2026 at 06:39 PM James Houghton <[email protected]> 
> > wrote:
> >> +    /*
> >> +     * Tracing programs may run in any context, including kernel threads
> >> +     * and exiting tasks, which have no user memory to read. That's not a
> >> +     * kernel bug, so fail before the user copy helpers warn about it.
> >> +     */
> >> +    if (unlikely(!current->mm))
> >> +            ret = -EFAULT;
> >> +    else
> >> +            ret = copy_from_user_nofault(dst, unsafe_ptr, size);
> >
> > The nofault helpers exist for callers that run in any context.
> > v1 had the check inside the helpers. That was the right place.
> > Nack to v2.
>
> Looking through it all again, I agree with this now, as it simplifies
> the rules. If {copy_from,strncpy_from,strnlen}_user_nofault()
> silently fail on !current->mm, a couple of patches in this series
> are no longer needed, and James has checked the remaining users
> for correctness.

Thanks Alexei, Arnd. I'm happy to go back to how v1 did it (so we can
drop patches 6-8). Here's a WIP of v3 if you want to take a look [1].

[1] https://github.com/48ca/linux uaccess-v3-wip

Reply via email to