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]
Date:	Sat, 12 May 2012 17:01:47 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	fweisbec@...il.com, mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] ftrace: No return value for ftrace_process_locs

On Tue, May 08, 2012 at 10:19:20AM -0400, Steven Rostedt wrote:
> On Wed, 2012-04-25 at 10:23 +0200, Jiri Olsa wrote:
> > The return value of ftrace_process_locs is never checked. The function
> > tries to update as many calls as possible and in case of error there's
> > either warning output or ftrace_bug call.
> > 
> > Signed-off-by: Jiri Olsa <jolsa@...hat.com>
> > ---
> >  kernel/trace/ftrace.c |   37 ++++++++++++++++---------------------
> >  1 files changed, 16 insertions(+), 21 deletions(-)
> > 
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index b3ceecd..e67f5b3 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -1930,7 +1930,7 @@ static int ops_traces_mod(struct ftrace_ops *ops)
> >  	return ftrace_hash_empty(hash);
> >  }
> >  
> > -static int ftrace_update_code(struct module *mod)
> > +static void ftrace_update_code(struct module *mod)
> >  {
> >  	struct ftrace_page *pg;
> >  	struct dyn_ftrace *p;
> > @@ -1959,7 +1959,7 @@ static int ftrace_update_code(struct module *mod)
> >  		for (i = 0; i < pg->index; i++) {
> >  			/* If something went wrong, bail without enabling anything */
> >  			if (unlikely(ftrace_disabled))
> > -				return -1;
> > +				return;
> >  
> >  			p = &pg->records[i];
> >  			p->flags = ref;
> > @@ -1968,8 +1968,8 @@ static int ftrace_update_code(struct module *mod)
> >  			 * Do the initial record conversion from mcount jump
> >  			 * to the NOP instructions.
> >  			 */
> > -			if (!ftrace_code_disable(mod, p))
> > -				break;
> > +			if (WARN_ON_ONCE(!ftrace_code_disable(mod, p)))
> > +				return;
> 
> Why the warning? If ftrace_disabled is set, something broke a long time
> ago, and the ftrace_bug gives its own warning.
> 
> I don't think this is needed.

right, I missed the ftrace_disabled case..

About the ftrace_update_code/ftrace_process_locs return values..
I still think the void is better, because we dont change the code
path in case it fails and all errors are already reported.

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