From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141AbbBSAMj (ORCPT ); Wed, 18 Feb 2015 19:12:39 -0500 Received: from mail-wg0-f46.google.com ([74.125.82.46]:35602 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751969AbbBSAMh (ORCPT ); Wed, 18 Feb 2015 19:12:37 -0500 Date: Thu, 19 Feb 2015 01:12:33 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: Rusty Russell , Andrey Tsyvarev , linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] kernel/module.c: Free lock-classes if parse_args failed Message-ID: <20150219001233.GC10076@gmail.com> References: <1421216708-1975-1-git-send-email-tsyvarev@ispras.ru> <87iog2arfk.fsf@rustcorp.com.au> <20150120094805.GB11596@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150120094805.GB11596@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra wrote: > On Tue, Jan 20, 2015 at 05:07:19PM +1030, Rusty Russell wrote: > > Andrey Tsyvarev writes: > > > parse_args call module parameters' .set handlers, which may use locks defined in the module. > > > So, these classes should be freed in case parse_args returns error(e.g. due to incorrect parameter passed). > > > > Thanks, this seems right. Applied. > > > > But this makes me ask: where is lockdep_free_key_range() called on the > > module init code? It doesn't seem to be at all... > > Hmm, Ingo, how does this work? The lockless class lookup in > look_up_lock_class() very much assumes the class hash is only added too, > but here we go wipe stuff from it. > > From what I can tell, every use of lockdep_free_key_range() is broken. indeed ... Thanks, Ingo