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-next>] [day] [month] [year] [list]
Message-Id: <20091209153204.F4CD.A69D9226@jp.fujitsu.com>
Date:	Wed,  9 Dec 2009 15:35:46 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	linux-kernel@...r.kernel.org, mingo@...hat.com, hpa@...or.com,
	rostedt@...dmis.org, srostedt@...hat.com, tglx@...utronix.de
Cc:	kosaki.motohiro@...fujitsu.com, linux-tip-commits@...r.kernel.org,
	hpa@...or.com, mingo@...hat.com, rostedt@...dmis.org,
	srostedt@...hat.com, tglx@...utronix.de
Subject: Re: [tip:tracing/urgent] tracing: Add pipe_close interface

> Commit-ID:  c521efd1700a8c0f7ce26f011f5eaecca17fabfa
> Gitweb:     http://git.kernel.org/tip/c521efd1700a8c0f7ce26f011f5eaecca17fabfa
> Author:     Steven Rostedt <srostedt@...hat.com>
> AuthorDate: Mon, 7 Dec 2009 09:06:24 -0500
> Committer:  Steven Rostedt <rostedt@...dmis.org>
> CommitDate: Mon, 7 Dec 2009 12:01:35 -0500
> 
> tracing: Add pipe_close interface
> 
> An ftrace plugin can add a pipe_open interface when the user opens
> trace_pipe. But if the plugin allocates something within the pipe_open
> it can not free it because there exists no pipe_close. The hook to
> the trace file open has a corresponding close. The closing of the
> trace_pipe file should also have a corresponding close.
> 
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> ---
>  kernel/trace/trace.c |    4 ++++
>  kernel/trace/trace.h |    2 ++
>  2 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 874f289..f804b40 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -2898,6 +2898,10 @@ static int tracing_release_pipe(struct inode *inode, struct file *file)
>  	else
>  		cpumask_clear_cpu(iter->cpu_file, tracing_reader_cpumask);
>  
> +
> +	if (iter->trace->pipe_open)
> +		iter->trace->pipe_close(iter);
> +

What's happen if pipe_close is NULL? Wny following straightforward check
is wrong?
I mean the above description explain pipe_close is only useful if plugin
allocate something at pipe_open. then allowing NULL seems natural.

	if (iter->trace->pipe_close)
		iter->trace->pipe_close(iter);

just nit.




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