Kernel WARNING at lib/vsprintf.c:2721 while running ftrace kernel selftests

Steven Rostedt rostedt at goodmis.org
Wed Feb 28 01:18:58 AEDT 2024


On Tue, 27 Feb 2024 15:06:18 +0530
Sachin Sant <sachinp at linux.ibm.com> wrote:

> I used this setup to again run bisect between 6.7.0 and 6.8-rc1.
> Bisect points to following patch 
> 
> commit 8ec90be7f15fac42992ea821be929d3b06cd0fd9
>     tracing: Allow for max buffer data size trace_marker writes

Thanks, that was what I was looking for. Hmm, can you send me your config.
One thing that powerpc architecture has different is that the page size can
be much larger, and the calculations are based off of that.

Can you try this patch and see if it triggers?

Thanks,

-- Steve

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 3e7fa44dc2b2..c3dba537f342 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -1589,6 +1589,9 @@ static enum print_line_t trace_print_print(struct trace_iterator *iter,
 	struct trace_seq *s = &iter->seq;
 	int max = iter->ent_size - offsetof(struct print_entry, buf);
 
+	if (WARN_ON_ONCE(max < 0))
+		return TRACE_TYPE_UNHANDLED;
+
 	trace_assign_type(field, iter->ent);
 
 	seq_print_ip_sym(s, field->ip, flags);


More information about the Linuxppc-dev mailing list