Re: [PATCH v2 1/2] tracing/user_events: validate dynamic cpumask size

From: Steven Rostedt

Date: Wed Nov 18 2026 - 13:34:46 EST


On Wed, 4 Nov 2026 21:39:29 +0000
Beau Belgrave <beaub@xxxxxxxxxxxxxxxxxxx> wrote:

>
> Hey Yifan,
>
> In the V1 there was a repro case where this value was a __data_loc,
> which defines where the actual data (and it's size) is in the payload.
>
> There isn't a type min-size requirement when __data_loc is used, this
> seems like the bug resides possibly in filter_match_preds for
> __data_loc cases? See comments futher down.
>
> Steve, do you think this is the case?

Yes, this patch appears to be addressing one of the symptoms of the bug but
not the bug itself. I ran the repro.c from v1 and the format file has this:

name: ue_short_cpumask
ID: 1969
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;

field:__data_loc cpumask_t mask; offset:8; size:4; signed:1;

print fmt: "mask=%llu", REC->mask

The key is the "__data_loc" which means at offset 8, there's a 4 byte
metadata which has the real location of the data and the size of that data.

The bug is real, but this doesn't look like the fix.

-- Steve