[PATCH v3 15/16] tracing/filters: Fix error position for within filter operator check
From: Masami Hiramatsu (Google)
Date: Tue Oct 27 2026 - 20:49:55 EST
From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
In parse_pred(), when the '~' operator is used with a 'within' filter,
'pos + i' points to the closing quote of the operand rather than to
the unsupported '~' operator.
Pass 'pos + op_pos' so the error caret points to the invalid operator.
Fixes: 7884b0bf098c ("tracing: Add "within" filter for call-stack-based event filtering")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
---
Changes in v3:
- Newly added to fix error position for within filter operator check.
---
kernel/trace/trace_events_filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 291c9805e119..bd54fa6e58ee 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -2096,7 +2096,7 @@ static int parse_pred(const char *str, void *data,
unsigned long func;
if (op == OP_GLOB) {
- parse_error(pe, FILT_ERR_GLOB_WITHIN, pos + i);
+ parse_error(pe, FILT_ERR_GLOB_WITHIN, pos + op_pos);
goto err_free;
}