Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141071155
D19874.id56043.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1022 B
Referenced Files
None
Subscribers
None
D19874.id56043.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D19874: Use shared vnode locks for ELF interpreter
Attached
Detach File
Event Timeline
Log In to Comment