summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-10-02 16:04:50 +0000
committerkib <kib@FreeBSD.org>2010-10-02 16:04:50 +0000
commit0b7460fc16c04cf0d0ced5c3152070486883f96c (patch)
treed36404cb078641a8d20a3e6954eb1b7dc40713a3 /sys/kern/link_elf.c
parent2d4f0a4a82f1cf5b082a40443abbe715d7419c78 (diff)
downloadFreeBSD-src-0b7460fc16c04cf0d0ced5c3152070486883f96c.zip
FreeBSD-src-0b7460fc16c04cf0d0ced5c3152070486883f96c.tar.gz
Release the vnode lock and close the linker file vnode earlier in
the linker_load_file methods. The change is that the consequent linker_file_unload() call is not under the vnode lock anymore. This prevents the LOR between kernel linker sx xlock and vnode lock, because linker_file_unload() relocks kernel linker lock. MFC after: 2 weeks
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index b389ace..eaaefde 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -967,15 +967,15 @@ nosyms:
*result = lf;
out:
+ VOP_UNLOCK(nd.ni_vp, 0);
+ vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
+ VFS_UNLOCK_GIANT(vfslocked);
if (error && lf)
linker_file_unload(lf, LINKER_UNLOAD_FORCE);
if (shdr)
free(shdr, M_LINKER);
if (firstpage)
free(firstpage, M_LINKER);
- VOP_UNLOCK(nd.ni_vp, 0);
- vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
- VFS_UNLOCK_GIANT(vfslocked);
return error;
}
OpenPOWER on IntegriCloud