Re: [PATCH v4 07/15] tracing/filters: Reject empty unquoted operand in function event filter

From: Masami Hiramatsu (Google)

Date: Wed Nov 18 2026 - 20:12:24 EST


On Tue, 17 Nov 2026 19:15:44 -0500, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Thu, 29 Oct 2026 10:38:30 +0900
> "Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> wrote:
>
> > In parse_pred(), when parsing an unquoted operand for function events,
> > if the filter expression has no operand before a delimiter (e.g.
> > '(ip == )' or '(ip == && x == 1)'), the loop terminates with len == 0.
>
> Please show actual examples for this too. Not just showing "this breaks",
> but the actual echo commands that are written to the tracefs file system
> and how they fail, or not fail.

This also requires `perf` tool to reproduce the issue.

# perf record -e ftrace:function --filter '(ip == ) || ip == schedule' -- sleep 1

But actually, this is rejected without this change, this is more
like a cleanup.

So please drop Cc: stable.

Thanks,

>
> Thanks,
>
> -- Steve
>
>
> >
> > While an empty quoted string (e.g. 'ip == ""') is syntactically valid
> > and denotes an empty pattern, an unquoted empty operand is a syntax
> > error where an operand was expected before the delimiter. Previously,
> > this accepted the predicate with an empty pattern.
> >
> > Reject empty unquoted operands by checking '!q && !len' and reporting
> > FILT_ERR_INVALID_VALUE.
> >
> > Fixes: 80765597bc58 ("tracing: Rewrite filter logic to be simpler and faster")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> > ---
>
>

--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>