[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150417095153.54953f33@gandalf.local.home>
Date: Fri, 17 Apr 2015 09:51:53 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Andrey Ryabinin <a.ryabinin@...sung.com>
Cc: Sasha Levin <sasha.levin@...cle.com>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Guilherme Cox <cox@...puter.org>,
Tony Luck <tony.luck@...il.com>,
Xie XiuQi <xiexiuqi@...wei.com>
Subject: Re: [PATCH 07/18 v3] tracing: Add TRACE_DEFINE_ENUM() macro to map
enums to their values
On Fri, 17 Apr 2015 09:29:02 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Fri, 17 Apr 2015 10:44:42 +0300
> Andrey Ryabinin <a.ryabinin@...sung.com> wrote:
>
>
> > And kasan is not needed to debug this further.
> > Just stick WARN_ON(ptr > call->print_fmt + strlen(call->print_fmt)) into the 'for' loop in update_event_printk().
>
> Thanks, although I think I found the bug with just inspection. I put in
> WARN_ON(*ptr) at various locations to see if it triggers.
Yep, that's the issue.
Can you guys test this patch please:
-- Steve
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 39bcfc3f071d..97d454a4dbfb 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1753,6 +1753,8 @@ static void update_event_printk(struct ftrace_event_call *call,
ptr++;
/* Check for alpha chars like ULL */
} while (isalnum(*ptr));
+ if (!*ptr)
+ break;
/*
* A number must have some kind of delimiter after
* it, and we can ignore that too.
@@ -1779,12 +1781,16 @@ static void update_event_printk(struct ftrace_event_call *call,
do {
ptr++;
} while (isalnum(*ptr) || *ptr == '_');
+ if (!*ptr)
+ break;
/*
* If what comes after this variable is a '.' or
* '->' then we can continue to ignore that string.
*/
if (*ptr == '.' || (ptr[0] == '-' && ptr[1] == '>')) {
ptr += *ptr == '.' ? 1 : 2;
+ if (!*ptr)
+ break;
goto skip_more;
}
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists