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]
Date:	Thu, 1 Aug 2013 16:08:56 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	"zhangwei(Jovi)" <jovi.zhangwei@...wei.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC][PATCH 4/4] tracing/uprobes: Fail to unregister if probe
	event files are open

On 07/03, Steven Rostedt wrote:
>
> From: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>

Acked-by: Oleg Nesterov <oleg@...hat.com>


Just a couple of nits in the case you are going to redo this change,

> Modules do with with the module owner set (automated
> from the VFS layer).

This logic is dead, I think.

> The ftrace buffer instances have a ref count added
> to the trace_array when the enabled file is opened

This is too.

> -static void cleanup_all_probes(void)
> +static int cleanup_all_probes(void)
>  {
>  	struct trace_uprobe *tu;
> +	int ret = 0;
>  
>  	mutex_lock(&uprobe_lock);
>  	while (!list_empty(&uprobe_list)) {
>  		tu = list_entry(uprobe_list.next, struct trace_uprobe, list);
> -		unregister_trace_uprobe(tu);
> +		ret = unregister_trace_uprobe(tu);
> +		if (ret)
> +			break;
>  	}
>  	mutex_unlock(&uprobe_lock);
> +	return ret;
>  }

Again, it is not clear what exactly we should do and I won't argue
either way. But note that (with or without this patch) this doesn't
match kprobe's release_all_trace_probes() which checks (tries to,
actually) trace_probe_is_enabled() for every probe first. Perhaps
we should cleanup this later.

>  static int probes_open(struct inode *inode, struct file *file)
>  {
> +	int ret = 0;
> +
>  	if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC))
> -		cleanup_all_probes();
> +		ret = cleanup_all_probes();
> +	if (ret)
> +		return ret;

Cosmetic, but perhaps it would be a bit more clean to move this check
(with "int ret") under if (WRITE && TRUNC) block.

Oleg.

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