Re: [PATCH 2/2] auth_gss: unregister gss_domain when unloading module

From: Neil Brown
Date: Mon Oct 30 2006 - 23:13:39 EST


On Tuesday October 31, akinobu.mita@xxxxxxxxx wrote:
>
> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/