diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-07-20 19:12:29 +0900 |
|---|---|---|
| committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-07-21 10:23:17 +0900 |
| commit | 8ce20bfba48902e1382187cd1a852f7cf3a1e739 (patch) | |
| tree | fb040eb6ed2f5f03519ff8ab950d4c779b23a9ce /tools/perf/scripts/python | |
| parent | a9d6fb284039a5d3858a1d9f9a0d7e46cfb7c2d4 (diff) | |
tracing/probes: Fix potential underflow in LEN_OR_ZERO macro
In __set_print_fmt(), LEN_OR_ZERO is defined as (len ? len - pos : 0).
If len is non-zero but smaller than pos, len - pos evaluates to a negative
integer. When passed as a size argument to snprintf(), this negative value
is cast to a large unsigned size_t, bypassing buffer size limits.
Ensure len > pos before subtracting to avoid integer underflow.
Link: https://lore.kernel.org/all/178454234934.290363.15247317871499514139.stgit@devnote2/
Fixes: 5bf652aaf46c ("tracing/probes: Integrate duplicate set_print_fmt()")
Cc: stable@vger.kernel.org
Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
