* [PATCH 2/2] tracing: Check operator stack capacity before pushing
@ 2026-10-15 17:19 Taeyang Lee
0 siblings, 0 replies; only message in thread
From: Taeyang Lee @ 2026-10-15 17:19 UTC (permalink / raw)
To: linux-trace-kernel; +Cc: rostedt, mhiramat
predicate_parse() uses the first operator stack entry before processing
any opening parentheses. A push then increments top before writing.
The existing check still permits that write when top already points to
the last allocated entry, which can access beyond the operator stack.
Reject the push when top reaches the last allocated entry.
Fixes: 39f7c41c908b ("tracing/filters: Enable filtering a cpumask field by another cpumask")
Cc: stable@vger.kernel.org
Signed-off-by: Taeyang Lee <0wn@theori.io>
---
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 781416ba6..127880ebe 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -511,7 +511,7 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
switch (*next) {
case '(': /* #2 */
- if (top - op_stack > nr_parens) {
+ if (top - op_stack >= nr_parens - 1) {
ret = -EINVAL;
goto out_free;
}
--
2.51.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-15 17:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 17:19 [PATCH 2/2] tracing: Check operator stack capacity before pushing Taeyang Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox