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.

pw-bot: cr

Reply via email to