All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: linux-kernel@vger.kernel.org,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	yrl.pp-manager.tt@hitachi.com, Oleg Nesterov <oleg@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	Tom Zanussi <tom.zanussi@intel.com>
Subject: Re: [PATCH 1/5] [BUGFIX] tracing: Returns -EBUSY when event_enable_func fails to get module
Date: Thu, 16 May 2013 10:58:02 -0400	[thread overview]
Message-ID: <1368716282.6828.100.camel@gandalf.local.home> (raw)
In-Reply-To: <20130516114848.13508.97899.stgit@mhiramat-M0-7522>

On Thu, 2013-05-16 at 20:48 +0900, Masami Hiramatsu wrote:
> Since try_module_get returns false( = 0) when it fails to
> pindown a module, event_enable_func() returns 0 which means
> "succeed". This can cause a kernel panic when the entry
> is removed, because the event is already released.
> 
> This fixes the bug by returning -EBUSY, because the reason
> why it fails is under removing module at that time.
> 

Thanks, this looks to be something that needs to go in right away.

-- Steve

> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> ---
>  kernel/trace/trace_events.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 7a0cf68..27963e2 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -2072,8 +2072,10 @@ event_enable_func(struct ftrace_hash *hash,
>   out_reg:
>  	/* Don't let event modules unload while probe registered */
>  	ret = try_module_get(file->event_call->mod);
> -	if (!ret)
> +	if (!ret) {
> +		ret = -EBUSY;
>  		goto out_free;
> +	}
>  
>  	ret = __ftrace_event_enable_disable(file, 1, 1);
>  	if (ret < 0)



  reply	other threads:[~2013-05-16 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 11:48 [PATCH 0/5] Add glob pattern matching support on trigger and kprobe-event Masami Hiramatsu
2013-05-16 11:48 ` [PATCH 1/5] [BUGFIX] tracing: Returns -EBUSY when event_enable_func fails to get module Masami Hiramatsu
2013-05-16 14:58   ` Steven Rostedt [this message]
2013-05-16 11:48 ` [PATCH 2/5] perf: Reorder parameters of strglobmatch Masami Hiramatsu
2013-05-16 14:55   ` Steven Rostedt
2013-05-17  2:21     ` Masami Hiramatsu
2013-05-21  9:19       ` Arnaldo Carvalho de Melo
2013-05-21  9:49         ` Masami Hiramatsu
2013-05-16 11:48 ` [PATCH 3/5] lib/string: Add a generic wildcard string matching function Masami Hiramatsu
2013-05-16 11:48 ` [PATCH 4/5] tracing/kprobes: Allow user to delete kprobe events by wild cards Masami Hiramatsu
2013-05-16 11:49 ` [PATCH 5/5] tracing: Support enable/disable multiple events trigger " Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368716282.6828.100.camel@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=tom.zanussi@intel.com \
    --cc=yrl.pp-manager.tt@hitachi.com \
    --subject='Re: [PATCH 1/5] [BUGFIX] tracing: Returns -EBUSY when event_enable_func fails to get module' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.