Re: [GIT PULL] ftrace: Fixes for v6.13
From: Steven Rostedt
Date: Sun Dec 15 2024 - 05:25:06 EST
On Sun, 15 Dec 2024 05:05:17 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> That commit fixes the iter->fmt being passed into the function by making
> the assumption that p will iterate over the temp buffer. It has nothing to
> do with the current code that hasn't seen a bug since 2022, and has stopped
> constant "%s" bugs since then.
In fact, I could have fixed this with this one line change:
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index be62f0ea1814..d990687335b1 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3722,6 +3722,10 @@ void trace_check_vprintf(struct trace_iterator *iter, const char *fmt,
if (static_branch_unlikely(&trace_no_verify))
goto print;
+ /* If hash-ptr is not set, the fmt points to our temp buffer */
+ if (p == iter->fmt)
+ goto print;
+
/*
* When the kernel is booted with the tp_printk command line
* parameter, trace events go directly through to printk().
-- Steve