Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934250AbbDQOPT (ORCPT ); Fri, 17 Apr 2015 10:15:19 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:8289 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933215AbbDQOPK (ORCPT ); Fri, 17 Apr 2015 10:15:10 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-f4-5531156d1c0f Message-id: <55311562.6050102@samsung.com> Date: Fri, 17 Apr 2015 17:14:58 +0300 From: Andrey Ryabinin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-version: 1.0 To: Steven Rostedt Cc: Sasha Levin , linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Arnaldo Carvalho de Melo , Namhyung Kim , Masami Hiramatsu , Mathieu Desnoyers , Guilherme Cox , Tony Luck , Xie XiuQi Subject: Re: [PATCH 07/18 v3] tracing: Add TRACE_DEFINE_ENUM() macro to map enums to their values References: <20150403013802.220157513@goodmis.org> <20150403014123.997385206@goodmis.org> <552E661D.5060502@oracle.com> <20150415100549.09cabb59@gandalf.local.home> <552F0937.4010009@oracle.com> <20150416232116.39cd9f74@grimm.local.home> <5530852A.70202@oracle.com> <5530B9EA.9070203@samsung.com> <20150417092902.630bcb95@gandalf.local.home> <20150417095153.54953f33@gandalf.local.home> In-reply-to: <20150417095153.54953f33@gandalf.local.home> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42I5/e/4Fd1cUcNQg/W3TSy67u1gs5izfg2b xdQJS5ksLu+aw2axfu8aJovNZ88wW6z+d4rRomnZVhaLfR0PmCwWH7nNbHHiyh5mi8/L/7A5 8Hi0rOpl9lh6+g2bx85Zd9k9WvbdYvdoPbOGxaPlyFtWj02rOtk8Tsz4zeLx8ektFo/Pm+QC uKK4bFJSczLLUov07RK4Mj7N28tacIS34lPTGaYGxh6uLkZODgkBE4m7Tf/ZIWwxiQv31rN1 MXJxCAksZZS43t3JDOF8Z5Q43N3PBlLFK6Alcf7FWxYQm0VAVWJp60owm01AT+LfrO1ANRwc ogIRErcvc0KUC0r8mHwPrEREQEOiZcFzFpCZzAK7mSWuvmgH2ywskCzRdmAuK8SyHmaJLS+/ MYMkOAUsJZ6ffs8EMpQZaMH9i1ogYWYBeYnNa94yT2AUmIVkxyyEqllIqhYwMq9iFE0tTS4o TkrPNdQrTswtLs1L10vOz93ECImkLzsYFx+zOsQowMGoxMObMEUvVIg1say4MvcQowQHs5II L8c2g1Ah3pTEyqrUovz4otKc1OJDjNIcLErivHN3vQ8REkhPLEnNTk0tSC2CyTJxcEo1MBbv 4YkR2eK6eN30DiVn9hn3WBs3bVmj+LrJdGKXwqzseq6bVhumLJi576dquu0rF/fXd9JuNCsE aWrZKVx9oi53T6GtsnGien792fdBlqe63ebNqnQ/zT0hysN3vU586PvnXOtfxn3JqYhVXnpB Y6fQMfZG86+aDo8TuzQ2ndzNEDSDZ5H1MSWW4oxEQy3mouJEAIjbQQegAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1922 Lines: 60 On 04/17/2015 04:51 PM, Steven Rostedt wrote: > On Fri, 17 Apr 2015 09:29:02 -0400 > Steven Rostedt wrote: > >> On Fri, 17 Apr 2015 10:44:42 +0300 >> Andrey Ryabinin 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: > Tested-by: Andrey Ryabinin > -- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/