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: <20111129100742.GA1602@m.brq.redhat.com>
Date:	Tue, 29 Nov 2011 11:07:42 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	fweisbec@...il.com, mingo@...hat.com, paulus@...ba.org,
	acme@...stprotocols.net, linux-kernel@...r.kernel.org,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 4/9] ftrace: Add enable/disable ftrace_ops control
 interface

On Mon, Nov 28, 2011 at 03:21:33PM -0500, Steven Rostedt wrote:
> 
> >  
> > @@ -311,6 +321,9 @@ static int __unregister_ftrace_function(struct ftrace_ops *ops)
> >  	if (ret < 0)
> >  		return ret;
> >  
> > +	if (ops->flags & FTRACE_OPS_FL_CONTROL)
> > +		jump_label_dec(&ftrace_ops_control);
> > +
> >  	if (ftrace_enabled)
> >  		update_ftrace_function();
> >  
> > @@ -3577,8 +3590,14 @@ ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip)
> >  	preempt_disable_notrace();
> >  	op = rcu_dereference_raw(ftrace_ops_list);
> >  	while (op != &ftrace_list_end) {
> > +		if (static_branch(&ftrace_ops_control))
> 
> Instead of doing a static_branch() here, which makes me really nervous,
> because this is called in function trace context, which has some strict
> rules of its own, and is probably prone to recursion, we could add
> another "ops" similar to the global_ops.
> 
> We could make a control_ops, and add all ops with the
> FTRACE_OPS_FL_CONTROL flag set to it. And then this function will have
> its own loop that it will check the disabled flag, for the ops
> registered to it.
> 
> This code doesn't need to be touched, we just add a layer of redirection
> for control ops and it will solve the jump_label issue.

sounds good, I'll make the change

thanks,
jirka

> 
> -- Steve
> 
> > +			if ((op->flags & FTRACE_OPS_FL_CONTROL) &&
> > +			    atomic_read(&op->disabled))
> > +				goto next;
> > +
> >  		if (ftrace_ops_test(op, ip))
> >  			op->func(ip, parent_ip);
> > + next:
> >  		op = rcu_dereference_raw(op->next);
> >  	};
> >  	preempt_enable_notrace();
> 
> 
--
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