Re: [PATCH 1/2] tracing/user_events: Handle ioctls from 32-bit tasks

From: Steven Rostedt

Date: Mon Nov 23 2026 - 15:49:40 EST


On Mon, 28 Sep 2026 12:14:23 -0500
Danish Khateeb <danishkhateeb03@xxxxxxxxx> wrote:

> The DIAG_IOCSREG, DIAG_IOCSDEL and DIAG_IOCSUNREG ioctl numbers are
> defined with pointer types, so their size field is 4 for 32-bit
> userspace and 8 for 64-bit userspace. user_events_data has no
> compat_ioctl handler, so on a 64-bit kernel every one of these ioctls
> from a 32-bit task fails with -ENOTTY and such a task cannot register
> any user events.
>
> struct user_reg and struct user_unreg are packed and only use fixed-size
> fields, so they have the same layout for 32-bit and 64-bit tasks. Add a
> compat_ioctl handler that maps the 32-bit ioctl numbers to the native
> ones and passes the argument through compat_ptr().
>
> Fixes: 7f5a08c79df3 ("user_events: Add minimal support for trace_event into ftrace")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Signed-off-by: Danish Khateeb <danishkhateeb03@xxxxxxxxx>
> ---

Note, because this was never supported on 64 bit machines, I'm putting it
into my queue for the next merge window. It's not a regression, it is
actually a feature. That is, the new feature is: Support 32 bit tasks on 64
bit machines.

-- Steve