Page MenuHomeFreeBSD

D19874.id56043.diff
No OneTemporary

D19874.id56043.diff

Index: sys/kern/imgact_elf.c
===================================================================
--- sys/kern/imgact_elf.c
+++ sys/kern/imgact_elf.c
@@ -744,7 +744,8 @@
imgp->object = NULL;
imgp->execlabel = NULL;
- NDINIT(nd, LOOKUP, LOCKLEAF | FOLLOW, UIO_SYSSPACE, file, curthread);
+ NDINIT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE,
+ file, curthread);
if ((error = namei(nd)) != 0) {
nd->ni_vp = NULL;
goto fail;
@@ -759,15 +760,20 @@
if (error)
goto fail;
- error = exec_map_first_page(imgp);
- if (error)
- goto fail;
-
/*
* Also make certain that the interpreter stays the same, so set
* its VV_TEXT flag, too.
*/
- VOP_SET_TEXT(nd->ni_vp);
+ if (VOP_IS_TEXT(nd->ni_vp) == 0) {
+ if (VOP_ISLOCKED(nd->ni_vp) != LK_EXCLUSIVE)
+ vn_lock(nd->ni_vp, LK_UPGRADE | LK_RETRY);
+ VOP_SET_TEXT(nd->ni_vp);
+ vn_lock(nd->ni_vp, LK_DOWNGRADE | LK_RETRY);
+ }
+
+ error = exec_map_first_page(imgp);
+ if (error)
+ goto fail;
imgp->object = nd->ni_vp->v_object;

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 1, 12:12 PM (1 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27436125
Default Alt Text
D19874.id56043.diff (1022 B)

Event Timeline