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>] [day] [month] [year] [list]
Message-ID: <1369249725.6828.180.camel@gandalf.local.home>
Date:	Wed, 22 May 2013 15:08:45 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Ingo Molnar <mingo@...nel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Tom Zanussi <tom.zanussi@...el.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Subject: [PATCH][GIT PULL] tracing: Return -EBUSY when event_enable_func()
 fails to get module


Linus,

Masami Hiramatsu fixed another bug. This time returning a proper
result in event_enable_func(). After checking the return status
of try_module_get(), it returned the status of try_module_get(). But
try_module_get() returns 0 on failure, which is success for
event_enable_func().

Please pull the latest trace-fixes-v3.10-rc2 tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-fixes-v3.10-rc2

Tag SHA1: f1733dffe0252fd03bf115d6b15b0e0842b3facd
Head SHA1: 6ed0106667d76589cb648c27edb4f4ffbf9d59ca


Masami Hiramatsu (1):
      tracing: Return -EBUSY when event_enable_func() fails to get module

----
 kernel/trace/trace_events.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---------------------------
commit 6ed0106667d76589cb648c27edb4f4ffbf9d59ca
Author: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Date:   Thu May 16 20:48:49 2013 +0900

    tracing: Return -EBUSY when event_enable_func() fails to get module
    
    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 that the module is being removed at that time.
    
    Link: http://lkml.kernel.org/r/20130516114848.13508.97899.stgit@mhiramat-M0-7522
    
    Cc: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
    Cc: Oleg Nesterov <oleg@...hat.com>
    Cc: Tom Zanussi <tom.zanussi@...el.com>
    Cc: Frederic Weisbecker <fweisbec@...il.com>
    Cc: Ingo Molnar <mingo@...hat.com>
    Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
    Signed-off-by: Steven Rostedt <rostedt@...dmis.org>

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)


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