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: <20180207120651.GB16048@krava>
Date:   Wed, 7 Feb 2018 13:06:51 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     linux-kernel@...r.kernel.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Tom Zanussi <tom.zanussi@...ux.intel.com>,
        linux-rt-users@...r.kernel.org, linux-trace-users@...r.kernel.org,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Clark Williams <williams@...hat.com>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Jonathan Corbet <corbet@....net>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexei Starovoitov <alexei.starovoitov@...il.com>
Subject: Re: [PATCH 01/18] tracing: Add function based events

On Tue, Feb 06, 2018 at 10:09:17PM -0500, Steven Rostedt wrote:
> On Mon, 5 Feb 2018 10:00:50 -0500
> Steven Rostedt <rostedt@...dmis.org> wrote:
> 
> > On Mon, 5 Feb 2018 09:24:23 +0100
> > Jiri Olsa <jolsa@...hat.com> wrote:
> > 
> > 
> > > should this be done under 'func_event_mutex' ?  
> > 
> > Probably.
> 
> I think we only need to add the list.

yep, seems enough

jirka

> 
> > 
> > > 
> > > I tried and crashed the system by running 2 scripts with:
> > > 
> > >   echo 'ip_rcv(u64 skb, u64 dev)' > /sys/kernel/debug/tracing/function_events
> > >   echo 'SyS_openat(int dfd, string buf, x32 flags, x32 mode)' >> /sys/kernel/debug/tracing/function_events
> > >   echo 'SyS_open(x8[32] buf, x32 flags, x32 mode)' >> /sys/kernel/debug/tracing/function_events
> > >  
> > 
> 
> There's no reason that we can't have more than one function  event
> attached to the same function. I'm adding this:
> 
> diff --git a/kernel/trace/trace_event_ftrace.c b/kernel/trace/trace_event_ftrace.c
> index b145639eac45..928168fc2025 100644
> --- a/kernel/trace/trace_event_ftrace.c
> +++ b/kernel/trace/trace_event_ftrace.c
> @@ -1275,12 +1275,6 @@ static int create_function_event(int argc, char **argv)
>  	if (state != FUNC_STATE_END)
>  		goto fail;
>  
> -	ret = -EALREADY;
> -	list_for_each_entry(fe, &func_events, list) {
> -		if (strcmp(fe->func, func_event->func) == 0)
> -			goto fail;
> -	}
> -
>  	ret = ftrace_set_filter(&func_event->ops, func_event->func,
>  				strlen(func_event->func), 0);
>  	if (ret < 0)
> @@ -1290,7 +1284,9 @@ static int create_function_event(int argc, char **argv)
>  	if (ret < 0)
>  		goto fail;
>  
> +	mutex_lock(&func_event_mutex);
>  	list_add_tail(&func_event->list, &func_events);
> +	mutex_unlock(&func_event_mutex);
>  	return 0;
>   fail:
>  	free_func_event(func_event);
> 
> -- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ