summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-08-03 13:33:45 +0000
committerkib <kib@FreeBSD.org>2008-08-03 13:33:45 +0000
commit52aa4f35d0227eddf0791072be3baac35944788a (patch)
tree7603ee0923284048aefc51b770a8cdbd676830f7 /sys/kern/link_elf.c
parent7237d2d9a2e1a1f1f650979348ff92f8e2c449dd (diff)
downloadFreeBSD-src-52aa4f35d0227eddf0791072be3baac35944788a.zip
FreeBSD-src-52aa4f35d0227eddf0791072be3baac35944788a.tar.gz
Calling linker_load_dependencies() while holding the module'
vnode lock may cause a LOR between kld_sx lock and vnode lock. linker_load_dependencies() drops kld_sx, and another thread may attempt to load the same kld. Reported and tested by: pjd MFC after: 1 week
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 2664ba9..52b3f8f 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -802,7 +802,9 @@ link_elf_load_file(linker_class_t cls, const char* filename,
goto out;
link_elf_reloc_local(lf);
+ VOP_UNLOCK(nd.ni_vp, 0);
error = linker_load_dependencies(lf);
+ vn_lock(nd.ni_vp, LK_EXCLUSIVE | LK_RETRY);
if (error)
goto out;
#if 0 /* this will be more trouble than it's worth for now */
OpenPOWER on IntegriCloud