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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081126130847.GA20988@localhost>
Date:	Wed, 26 Nov 2008 21:08:48 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Cc:	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Avi Kivity <avi@...hat.com>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Nick Piggin <npiggin@...e.de>
Subject: Re: [PATCH] markers: comment usage of
	marker_synchronize_unregister()

On Wed, Nov 26, 2008 at 02:46:08PM +0200, Mathieu Desnoyers wrote:
> * Wu Fengguang (fengguang.wu@...el.com) wrote:
> > Add more comments to marker_synchronize_unregister() in order to
> > reduce the chance of misusing.
> > 
> > Based on comments from Lai Jiangshan <laijs@...fujitsu.com>.
> > 
> > Cc: Lai Jiangshan <laijs@...fujitsu.com>
> > Cc: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
> > Signed-off-by: Wu Fengguang <wfg@...ux.intel.com>
> > ---
> > 
> > I'm still not sure about the last sentence. Can anyone clarify on
> > this? Thanks!
> > 
> > diff --git a/include/linux/marker.h b/include/linux/marker.h
> > index 889196c..89ce1b8 100644
> > --- a/include/linux/marker.h
> > +++ b/include/linux/marker.h
> > @@ -164,6 +164,12 @@ extern void *marker_get_private_data(const char *name, marker_probe_func *probe,
> >   * marker_synchronize_unregister must be called between the last marker probe
> >   * unregistration and the end of module exit to make sure there is no caller
> >   * executing a probe when it is freed.
> > + *
> > + * It must be called _also_ between unregistration and destruction the data
> > + * that unregistration-ed probes need to make sure there is no caller executing
> > + * a probe when it's data is destroyed.
> 
> it's -> its
> 
> And the way it's written, this last sentence is a bit misleading. One
> might think that the synchronize_unregister has to be called two, when
> in fact it just has to be called once, but it must be called at a moment
> in time between unregister and free of any resource used by the probes,
> including the code which is removed by module unload.
> 
> > + *
> > + * It works reliably only when all probe routines do not sleep and reschedule.
> 
> Per definition, preemption is disabled around marker probe execution, so
> I don't see why we should add this last sentence ?

Thanks, your reminder dismissed my confusion on this last sentence :-)

Updated patch according to your helpful comments.

Thank you,
Fengguang
---
markers: comment usage of marker_synchronize_unregister()

Add more comments to marker_synchronize_unregister() in order to
reduce the chance of misusing.

Based on comments from Lai Jiangshan and Mathieu Desnoyers.

Cc: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Signed-off-by: Wu Fengguang <wfg@...ux.intel.com>
---
diff --git a/include/linux/marker.h b/include/linux/marker.h
index 889196c..32ce4f2 100644
--- a/include/linux/marker.h
+++ b/include/linux/marker.h
@@ -162,8 +162,10 @@ extern void *marker_get_private_data(const char *name, marker_probe_func *probe,
 
 /*
  * marker_synchronize_unregister must be called between the last marker probe
- * unregistration and the end of module exit to make sure there is no caller
- * executing a probe when it is freed.
+ * unregistration and the first one of
+ * - the end of module exit
+ * - the free of any resource used by the probes
+ * to ensure the code and data are all valid for any possibly running probes.
  */
 #define marker_synchronize_unregister() synchronize_sched()
 
--
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