summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-09-18 22:07:51 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-09-18 22:07:51 +0000
commitcebe72e3222a41041436bd66ebafcc1815d3c2db (patch)
tree6e9a1cd1ad8d09ed1a619fa867da87678174ff3b /sys
parent02cd9bc70d585f93c8b112390d06defc09772757 (diff)
Mark ELF ld.so as VTEXT to prevent the file from being overwritten.
ok deraadt@ art@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/exec_elf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 078963448ce..68077f357ca 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.39 2002/08/22 22:04:42 art Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.40 2002/09/18 22:07:50 drahn Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -410,6 +410,8 @@ ELFNAME(load_file)(struct proc *p, char *path, struct exec_package *epp,
}
}
+ vn_marktext(nd.ni_vp);
+
bad1:
VOP_CLOSE(nd.ni_vp, FREAD, p->p_ucred, p);
bad: