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]
Message-Id: <20210819132836.fb3b0eb399971c37a05606dd@kernel.org>
Date:   Thu, 19 Aug 2021 13:28:36 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Tzvetomir Stoyanov" <tz.stoyanov@...il.com>,
        Tom Zanussi <zanussi@...nel.org>,
        linux-trace-devel@...r.kernel.org
Subject: Re: [PATCH v6 7/7] tracing: Add a probe that attaches to trace
 events

On Thu, 19 Aug 2021 00:03:42 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:

> On Thu, 19 Aug 2021 12:56:52 +0900
> Masami Hiramatsu <mhiramat@...nel.org> wrote:
> 
> > > static bool find_event_probe(const char *group, const char *event)
> > > {
> > > 	struct dyn_event *ev;
> > > 	struct trace_eprobe *ep;
> > > 
> > > 	for_each_dyn_event(ev) {
> > > 		if (ev->ops != &eprobe_dyn_event_ops)
> > > 			continue;
> > > 		
> > > 		ep = to_trace_eprobe(ev);
> > > 		if (strcmp(ep->tp.event->class.system, group) == 0 &&
> > > 		    strcmp(ep->tp.event->call.name, event) == 0)
> > > 			return true;
> > > 	}
> > > 	return false;
> > > }  
> > 
> > Yeah, but I think this should be done with event_mutex, shouldn't it?
> 
> Probably. I noticed that it was updated under the dyn_event_ops_mutex,
> and thought that was enough protection. But I now see the lockdep
> assert on the event_mutex in the other functions.
> 
> Is there ever a case where this list is updated without
> dyn_event_ops_mutex held?

dyn_event_ops_mutex is for the "dyn_event_ops_list" which manages
the list of "struct dyn_event_operations" (e.g. kprobe, uprobe, synthetic).

In kernel/trace/trace_dynevent.c, you can see,

/* Protected by event_mutex */
LIST_HEAD(dyn_event_list);

:)

Thank you,


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ