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] [day] [month] [year] [list]
Date:	Mon, 20 Jun 2016 09:12:51 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	<zhengjun.xing@...el.com>, <mingo@...hat.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing: Add *iter check for NULL

On Fri, Jun 17, 2016 at 02:24:57PM -0400, Steven Rostedt wrote:
> I tried your patch and it works until you remove the module and try
> reading the trace again. As I said, you left out later processing. This
> should not exit on error. Below is a patch I wrote, and it works well.
> 
> I'll add you as reported by.
> 
> Thanks!

Acked-by: Namhyung Kim <namhyung@...nel.org>

Thanks,
Namhyung


> diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c
> index f96f0383f6c6..ad1d6164e946 100644
> --- a/kernel/trace/trace_printk.c
> +++ b/kernel/trace/trace_printk.c
> @@ -36,6 +36,10 @@ struct trace_bprintk_fmt {
>  static inline struct trace_bprintk_fmt *lookup_format(const char *fmt)
>  {
>  	struct trace_bprintk_fmt *pos;
> +
> +	if (!fmt)
> +		return ERR_PTR(-EINVAL);
> +
>  	list_for_each_entry(pos, &trace_bprintk_fmt_list, list) {
>  		if (!strcmp(pos->fmt, fmt))
>  			return pos;
> @@ -57,7 +61,8 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
>  	for (iter = start; iter < end; iter++) {
>  		struct trace_bprintk_fmt *tb_fmt = lookup_format(*iter);
>  		if (tb_fmt) {
> -			*iter = tb_fmt->fmt;
> +			if (!IS_ERR(tb_fmt))
> +				*iter = tb_fmt->fmt;
>  			continue;
>  		}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ