lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Oct 2006 23:54:04 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Trond Myklebust <Trond.Myklebust@...app.com>
Cc:	linux-kernel@...r.kernel.org, Andy Adamson <andros@...i.umich.edu>,
	"J. Bruce Fields" <bfields@...i.umich.edu>,
	Olaf Kirch <okir@...ad.swb.de>
Subject: Re: [PATCH 2/2] auth_gss: unregister gss_domain when unloading module

On Sun, Oct 29, 2006 at 03:15:59PM -0500, Trond Myklebust wrote:

> > +void svcauth_gss_unregister_pseudoflavor(char *name)
> > +{
> > +	struct auth_domain *dom;
> > +
> > +	dom = auth_domain_find(name);
> > +	if (dom) {
> > +		auth_domain_put(dom);
> > +		auth_domain_put(dom);
> > +	}
> > +}
> 
> Strictly speaking, if you want to be smp-safe, you probably need
> something like the following:
> 
> 	dom = auth_domain_find(name);
> 	if (dom) {
> 		spin_lock(&auth_domain_lock);
> 		if (!hlist_unhashed(dom->hash)) {
> 			hlist_del_init(dom->hash);
> 			spin_unlock(&auth_domain_lock);
> 			auth_domain_put(dom);
> 		} else
> 			spin_unlock(&auth_domain_lock);
> 		auth_domain_put(dom);
> 	}
> 
> and then add a test for hlist_unhashed into auth_domain_put(). If not,
> some other processor could race you inside
> svcauth_gss_unregister_pseudoflavor.

But auth_domain_table is protected by auth_domain_lock while we are
using auth_domain_put()/auth_domain_lookup()/auth_domain_find().
So I think there is not big difference.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ