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

From: Steven Rostedt

Date: Tue Nov 17 2026 - 19:15:52 EST


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.

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>
> ---