lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <55311562.6050102@samsung.com>
Date:	Fri, 17 Apr 2015 17:14:58 +0300
From:	Andrey Ryabinin <a.ryabinin@...sung.com>
To:	Steven Rostedt <rostedt@...dmis.org>
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 04/17/2015 04:51 PM, Steven Rostedt wrote:
> 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:
> 

Tested-by: Andrey Ryabinin <a.ryabinin@...sung.com>

> -- 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ