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: <1277913629.24800.29.camel@gandalf.stny.rr.com>
Date:	Wed, 30 Jun 2010 12:00:29 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Bugfix] unregister_trace_probe needs to be called under mutex

On Wed, 2010-06-30 at 11:44 +0200, Peter Zijlstra wrote:
> On Wed, 2010-06-30 at 14:15 +0530, Srikar Dronamraju wrote:
> > Comment in unregister_trace_probe() says probe_lock will be held
> > when it gets called. However there is a case where it might called
> > without the probe_lock being held. Also since we are traversing the
> > probe_list and deleting an element from the probe_list, probe_lock
> > should be held.
> > 
> > This was first pointed in uprobes traceevent review by Frederic
> > Weisbecker here.  (http://lkml.org/lkml/2010/5/12/106)
> > 
> > This patch is needed for both 2.6.35-rc3 and 2.6.35-rc3-tip

Acked-by: Steven Rostedt <rostedt@...dmis.org>

> > 
> > Signed-off-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
> > ---
> > 
> > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> > index 4f11a56..67670cd 100644
> > --- a/kernel/trace/trace_kprobe.c
> > +++ b/kernel/trace/trace_kprobe.c
> > @@ -269,14 +269,17 @@ static int create_trace_probe(int argc, char **argv)
> >  			pr_info("Delete command needs an event name.\n");
> >  			return -EINVAL;
> >  		}
> > +		mutex_lock(&probe_lock);
> >  		tp = find_probe_event(event, group);
> >  		if (!tp) {
> > +			mutex_unlock(&probe_lock);
> >  			pr_info("Event %s/%s doesn't exist.\n", group, event);
> >  			return -ENOENT;
> >  		}
> >  		/* delete an event */
> >  		unregister_trace_probe(tp);
> >  		free_trace_probe(tp);
> > +		mutex_unlock(&probe_lock);
> >  		return 0;
> >  	}
> 
> Shouldn't all that go through steven's ->reg() interface?

Nah, this is specific to the kprobe code. Has really nothing to do with
the ->reg() interface.

-- Steve


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