Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbbGHVou (ORCPT ); Wed, 8 Jul 2015 17:44:50 -0400 Received: from ozlabs.org ([103.22.144.67]:49583 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbbGHVob (ORCPT ); Wed, 8 Jul 2015 17:44:31 -0400 From: Rusty Russell To: Peter Zijlstra , Arthur Marsh Cc: Mathieu Desnoyers , linux-kernel@vger.kernel.org, rostedt , Oleg Nesterov , "Paul E. McKenney" Subject: Re: [PATCH] module: Fix load_module() error path In-Reply-To: <20150708124127.GV18673@twins.programming.kicks-ass.net> References: <559B63A2.4030601@internode.on.net> <20150707072951.GM3644@twins.programming.kicks-ass.net> <1736781680.1883.1436286785932.JavaMail.zimbra@efficios.com> <559C3371.2030704@internode.on.net> <20150707215620.GM19282@twins.programming.kicks-ass.net> <20150707221122.GU18673@twins.programming.kicks-ass.net> <559CDFE1.7060503@internode.on.net> <20150708090427.GY3644@twins.programming.kicks-ass.net> <559D0CD3.9000407@internode.on.net> <20150708123244.GO19282@twins.programming.kicks-ass.net> <20150708124127.GV18673@twins.programming.kicks-ass.net> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 09 Jul 2015 07:03:03 +0930 Message-ID: <87zj36tjw0.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1570 Lines: 44 Peter Zijlstra writes: > 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 ;-) Thanks, Rusty is happy :) Applied, and pushed to Linus. Cheers, Rusty. > --- > Subject: module: Fix load_module() error path > From: Peter Zijlstra > 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 > Reported-by: Arthur Marsh > Tested-by: Arthur Marsh > Fixes: 93c2e105f6bc ("module: Optimize __module_address() using a latched RB-tree") > Signed-off-by: Peter Zijlstra (Intel) > --- > 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(); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/