summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf_obj.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_obj.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_obj.c')
-rw-r--r--sys/kern/link_elf_obj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index d8e9219..29165fe 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -798,7 +798,9 @@ link_elf_load_file(linker_class_t cls, const char *filename,
link_elf_reloc_local(lf);
/* Pull in dependencies */
+ VOP_UNLOCK(nd.ni_vp, 0);
error = linker_load_dependencies(lf);
+ vn_lock(nd.ni_vp, LK_EXCLUSIVE | LK_RETRY);
if (error)
goto out;
OpenPOWER on IntegriCloud