All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Peter Zijlstra <peterz@infradead.org>,
	Arthur Marsh <arthur.marsh@internode.on.net>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org, rostedt <rostedt@goodmis.org>,
	Oleg Nesterov <oleg@redhat.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: lock-up with module: Optimize __module_address() using a latched RB-tree
Date: Wed, 08 Jul 2015 10:25:40 +0930	[thread overview]
Message-ID: <87d203v56b.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20150707221122.GU18673@twins.programming.kicks-ass.net>

Peter Zijlstra <peterz@infradead.org> writes:
> On Tue, Jul 07, 2015 at 11:56:20PM +0200, Peter Zijlstra wrote:
>> On Wed, Jul 08, 2015 at 05:45:45AM +0930, Arthur Marsh wrote:
>> > I'm not aware of any modules being loaded with --force .
>> > 
>> > I've applied the patch, thanks!
>> > 
>> > The resultant kernel locked up as follows:
>> > 
>> > http://www.users.on.net/~arthur.marsh/20150708469.jpg
>> 
>> This has "Not tainted" which would indeed rule out forced loading. So
>> much for that idea :/
>> 
>> > http://www.users.on.net/~arthur.marsh/20150708470.jpg
>> 
>> And that one has a bunch of NMI prints, curious those. But given Mathieu
>> made them return NULL, that completely rules out the most interesting
>> races.
>
> Could you try the below? It appears there was a spot freeing modules
> that forgot to take them out of the tree.

Ouch!  Good catch.

I'm testing that here.... Yep, "modprobe lp reset=7" (which fails to
parse) three times and then oops in __mod_tree_insert.

If you want to wrap that with a SOB and Reported-by/Tested-by if my
compatriot acks...

Thanks!
Rusty.

> ---
>  kernel/module.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 3e0e19763d24..4d2b82e610e2 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -3557,6 +3557,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
>  	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  0:56 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 [this message]
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                           ` [PATCH] module: Fix load_module() error path Peter Zijlstra
2015-07-08 21:33                             ` 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=87d203v56b.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --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=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /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.