All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Arthur Marsh <arthur.marsh@internode.on.net>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	rostedt <rostedt@goodmis.org>, Oleg Nesterov <oleg@redhat.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH] module: Fix load_module() error path
Date: Wed, 8 Jul 2015 14:41:27 +0200	[thread overview]
Message-ID: <20150708124127.GV18673@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20150708123244.GO19282@twins.programming.kicks-ass.net>

On Wed, Jul 08, 2015 at 02:32:44PM +0200, Peter Zijlstra wrote:

> Awesome, lemme go write up a proper patch to make Rusty happy too ;-)

---
Subject: module: Fix load_module() error path
From: Peter Zijlstra <peterz@infradead.org>
Date: Wed Jul 8 14:35:58 CEST 2015

The load_module() error path frees a module but forgot to take it out
of the mod_tree, leaving a dangling entry in the tree, causing havoc.

Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
Tested-by: Arthur Marsh <arthur.marsh@internode.on.net>
Fixes: 93c2e105f6bc ("module: Optimize __module_address() using a latched RB-tree")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/module.c |    1 +
 1 file changed, 1 insertion(+)

--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3557,6 +3557,7 @@ static int load_module(struct load_info
 	mutex_lock(&module_mutex);
 	/* Unlink carefully: kallsyms could be walking list. */
 	list_del_rcu(&mod->list);
+	mod_tree_remove(mod);
 	wake_up_all(&module_wq);
 	/* Wait for RCU-sched synchronizing before releasing mod->list. */
 	synchronize_sched();

  reply	other threads:[~2015-07-08 12:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-05 18:33 lock-up with module: Optimize __module_address() using a latched RB-tree Arthur Marsh
2015-07-06  7:19 ` Peter Zijlstra
2015-07-06  7:35   ` Arthur Marsh
2015-07-06  7:53   ` Arthur Marsh
2015-07-06  7:57   ` Peter Zijlstra
2015-07-06  8:12   ` Peter Zijlstra
2015-07-06  8:47     ` Arthur Marsh
2015-07-06  9:01       ` Peter Zijlstra
2015-07-06 10:04 ` Peter Zijlstra
2015-07-06 10:11   ` Arthur Marsh
2015-07-06 10:32     ` Peter Zijlstra
2015-07-06 11:26       ` Arthur Marsh
2015-07-07  5:29       ` Arthur Marsh
2015-07-07  7:29         ` Peter Zijlstra
2015-07-07 15:58           ` Arthur Marsh
2015-07-07 16:33           ` Mathieu Desnoyers
2015-07-07 20:15             ` Arthur Marsh
2015-07-07 21:56               ` Peter Zijlstra
2015-07-07 22:11                 ` Peter Zijlstra
2015-07-08  0:55                   ` Rusty Russell
2015-07-08  8:31                   ` Arthur Marsh
2015-07-08  9:04                     ` Peter Zijlstra
2015-07-08 11:43                       ` Arthur Marsh
2015-07-08 12:32                         ` Peter Zijlstra
2015-07-08 12:41                           ` Peter Zijlstra [this message]
2015-07-08 21:33                             ` [PATCH] module: Fix load_module() error path Rusty Russell

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=20150708124127.GV18673@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=arthur.marsh@internode.on.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.