Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161622AbWJaENM (ORCPT ); Mon, 30 Oct 2006 23:13:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161623AbWJaENM (ORCPT ); Mon, 30 Oct 2006 23:13:12 -0500 Received: from mx1.suse.de ([195.135.220.2]:58836 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1161622AbWJaENL (ORCPT ); Mon, 30 Oct 2006 23:13:11 -0500 From: Neil Brown To: "Akinobu Mita" Date: Tue, 31 Oct 2006 15:13:02 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17734.52558.476874.72042@cse.unsw.edu.au> Cc: "Trond Myklebust" , linux-kernel@vger.kernel.org, "Andy Adamson" , "J. Bruce Fields" , "Olaf Kirch" Subject: Re: [PATCH 2/2] auth_gss: unregister gss_domain when unloading module In-Reply-To: message from Akinobu Mita on Tuesday October 31 References: <20061028185554.GM9973@localhost> <20061029133551.GA10072@localhost> <20061029133700.GA10295@localhost> <20061029133816.GB10295@localhost> <1162152960.5545.57.camel@lade.trondhjem.org> <20061030145404.GA7258@localhost> <1162221449.5517.70.camel@lade.trondhjem.org> <961aa3350610301915i5a954dbemd5420a350fd0c625@mail.gmail.com> X-Mailer: VM 7.19 under Emacs 21.4.1 X-face: [Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9D > But I noticed that even if we have this kind of smp-safe code, there > is no guarantee that 2nd auth_domain_put() in > svcauth_gss_unregister_pseudoflavor() is the last reference of > this gss_domain. > > So it is possible to happen invalid dereference by real last user of > this gss_domain after unloading module. If this is not wrong, > Is it neccesary to have try_get_module()/put_module() somewhere to > prevent this? After a quick look, it seems to me that one reasonable option would be: svcauth_gss_register_pseudoflavor returns a void* which is 'new', and possible calls try_get_module(), failing if that fails. and svcauth_gss_unregister_pseudoflavor takes the void* (not a name) and calls auth_domain_put on it, and then calls put_module(). 'struct pf_desc' would have to gain a void * handle; to hold the returned value. Would that solve the problem as you see it? NeilBrown - 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/