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: <20090826194432.GA5298@Krystal>
Date:	Wed, 26 Aug 2009 15:44:32 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	Li Zefan <lizf@...fujitsu.com>, Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing/profile: Fix profile_disable vs module_unload

* Peter Zijlstra (peterz@...radead.org) wrote:
> On Wed, 2009-08-26 at 12:46 -0400, Mathieu Desnoyers wrote:
> > Registering tracepoints even when no tracepoint definition is currently
> > visible is the intended allowed behavior. Let's say we need to trace
> > something happening in module init: if we disallow registering the tp
> > callback before the module is initialized, we run in a chicken and egg
> > problem.
> > 
> > So I am trying to figure out the problem source there. Is it that
> > modules containing the tp callbacks need to know if those are actually
> > connected to an instrumented module ? Or is it that the instrumented
> > module needs to know if a probe module is connected to is ? Or is it the
> > teardown of the probe module ? No refcount is needed there, because we
> > surround the probe call by preempt disable/enable, and we use
> > synchronize_sched() before removing the module which contains probe
> > callbacks.
> > 
> > Mathieu-trying-to-figure-out-what-this-whole-thread-is-about :)
> 
> OK, so the whole point seems to be that tracepoints have the funny thing
> you describe above, whereas the things ftrace makes out of TRACE_EVENT()
> get instantiated along with modules.
> 
> The reason why I rejected the initial patch (and I still think that that
> fix is at the wrong layer) is that I, as a consumer of whatever
> TRACE_EVENT() offers, should never need to consider modules.
> 

Hrm, is it just me, or include/trace/ftrace.h fails to call the
following function after tracepoint unregistration ?

/*
 * tracepoint_synchronize_unregister must be called between the last tracepoint
 * probe unregistration and the end of module exit to make sure there is no
 * caller executing a probe when it is freed.
 */
static inline void tracepoint_synchronize_unregister(void)
{
        synchronize_sched();
}

This might solve all our problems.

Basically, it does not need to be called after each individual
tracepoint unregistration, but does need to be called before removal of
the module containing the probles (e.g. in module exit()).

Mathieu

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
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