diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-10-29 10:38:11 +0900 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2026-11-20 10:02:35 -0500 |
| commit | 42647658bdd8434a90c1b63391081396f36820ba (patch) | |
| tree | 5cc0ceac1e887853c353345c20d5b6f2e9cc8b2f /rust/kernel/alloc/kvec/errors.rs | |
| parent | 87e0a196153e983a4d95903e7422b7d766cd37cf (diff) | |
tracing/filters: Check for missing operand after operator in parse_pred()
In parse_pred(), after matching the operator and skipping whitespace,
the filter string may terminate (str[i] == '\0') if the operand is
missing (e.g. "ip ==" or "common_pid ==").
For function events, the loop 'for (i++; str[i]; i++)' unconditionally
increments 'i' past the NUL terminator, causing an out-of-bounds read.
For other event types, allocating a predicate only to fail later during
value parsing is wasteful.
Check if 'str[i]' is NUL immediately after skipping whitespace after
the operator, and report FILT_ERR_INVALID_FILTER.
Cc: stable@vger.kernel.org
Fixes: 80765597bc58 ("tracing: Rewrite filter logic to be simpler and faster")
Link: https://patch.msgid.link/179323789181.740114.16161070743864669086.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions
