Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Mar 2002 13:08:43 -0500
From:      Jake Burkholder <jake@locore.ca>
To:        "Andrew R. Reiter" <arr@FreeBSD.ORG>
Cc:        freebsd-smp@FreeBSD.ORG
Subject:   Re: Patch to lock down modules
Message-ID:  <20020314130843.B52298@locore.ca>
In-Reply-To: <Pine.NEB.3.96L.1020314121224.97600B-100000@fledge.watson.org>; from arr@FreeBSD.ORG on Thu, Mar 14, 2002 at 12:15:21PM -0500
References:  <Pine.NEB.3.96L.1020314121224.97600B-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Apparently, On Thu, Mar 14, 2002 at 12:15:21PM -0500,
	Andrew R. Reiter said words to the effect of;

> Hi all,
> 
> I'd like to commit this patch soon, but I figure I should get
> a feeling from this list as to whether or not this is should be
> changed or if it's OK.  The patch is located at:
> 
> 	http://people.freebsd.org/~arr/modlock.diff
> 
> Testing and review are encouraged.

Couple problems:

I think that you missed a MOD_SLOCK before the
	newmod = module_lookupbyname(data->name);
in module_register.

Also in that function the MOD_XLOCK isn't needed until just before the
TAILQ_INSERT_TAIL.  The increment of nextid needs something, I would
probably move it to just before the TAILQ_INSERT, under the XLOCK.  An
atomic_add_and_return_old_value would be useful here.  Also, I think
that you should do another module_lookupbyname after acquiring the
XLOCK and before the TAILQ_INSERT, because conceivably another module
with the same name could show up when you release the SLOCK.

Can you explain the wierd logic that was added to linker_file_unload?

Thanks,
Jake

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020314130843.B52298>