Re: [PATCH] Fixup locking for kernel-linker, needs ndis testing(!)

From: Christian S.J. Peron <csjp_at_FreeBSD.org>
Date: Sat, 27 May 2006 10:12:08 -0500
Currently, we are using Giant to serialize access into the sysctl tree. 
This means that if the kernel linker is not picking up Giant, there 
could be a race between when the kernel modules load/unload sysctls, and 
somebody reading the sysctl tree.

I am not sure what the best thing to do here is yet. I've looked at the 
locking for sysctl tree, and locking these entry points can be sticky 
due to the recursive nature of the code.

John Baldwin wrote:
> I've reworked the locking for the kernel linker to convert the existing 
> kld_mtx to an sx lock and extend it's scope to cover all of the various 
> linker-related data structures.  I also changed the kernel linker API a bit 
> to make it more amenable to locking in that I added a 'linker_file_foreach' 
> that iterates over the list of linker files calling a supplied predicate 
> function and made the functions to lookup a linker file by name or index 
> private.  This meant that the ndis and hwpmc code had to stop fondling the 
> kernel linker internals.  I also made the VFS Giant locking in ndis and the 
> kernel linker conditional such that it only locks Giant for non-MPSAFE 
> filesystems.
>
> I have runtested this patch a while back, but the ndis and hwpmc parts have 
> only been compile tested.  Please test.
>
> http://www.FreeBSD.org/~jhb/patches/kld.patch
>
>   
-- 
Christian S.J. Peron
csjp_at_FreeBSD.ORG
FreeBSD Committer
FreeBSD Security Team
Received on Sat May 27 2006 - 13:12:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:56 UTC