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: <alpine.DEB.2.00.0907201158350.7595@gandalf.stny.rr.com>
Date:	Mon, 20 Jul 2009 11:59:22 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
cc:	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing: cleanup for tracing_trace_options_read()


On Mon, 22 Jun 2009, Xiao Guangrong wrote:

> '\n' is already appended, and what we need is just an extra
> space for the '\0'.

Hi Xiao,

I'm going through old email (or email lost in the shuffle) and I came 
across this lost patch. I'll go ahead an apply it.

Thanks,

-- Steve


> 
> Signed-off-by: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
> ---
>  kernel/trace/trace.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 076fa6f..4c3f856 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -2266,8 +2266,8 @@ tracing_trace_options_read(struct file *filp, char __user *ubuf,
>  		len += 3; /* "no" and newline */
>  	}
>  
> -	/* +2 for \n and \0 */
> -	buf = kmalloc(len + 2, GFP_KERNEL);
> +	/* +1 for \0 */
> +	buf = kmalloc(len + 1, GFP_KERNEL);
>  	if (!buf) {
>  		mutex_unlock(&trace_types_lock);
>  		return -ENOMEM;
> @@ -2290,7 +2290,7 @@ tracing_trace_options_read(struct file *filp, char __user *ubuf,
>  	}
>  	mutex_unlock(&trace_types_lock);
>  
> -	WARN_ON(r >= len + 2);
> +	WARN_ON(r >= len + 1);
>  
>  	r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
>  
> -- 
> 1.6.1.2
> 
> 
--
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