Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102074208
D42440.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42440.diff
View Options
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -862,6 +862,9 @@
if (error != 0)
goto fail;
+ if (p->p_sysent->sv_protect != NULL)
+ p->p_sysent->sv_protect(imgp, SVP_INTERP);
+
*addr = base_addr;
*entry = (unsigned long)hdr->e_entry + rbase;
@@ -1369,6 +1372,9 @@
entry = (u_long)hdr->e_entry + imgp->et_dyn_addr;
imgp->entry_addr = entry;
+ if (sv->sv_protect != NULL)
+ sv->sv_protect(imgp, SVP_IMAGE);
+
if (interp != NULL) {
VOP_UNLOCK(imgp->vp);
if ((map->flags & MAP_ASLR) != 0) {
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -149,6 +149,7 @@
vm_offset_t sv_fxrng_gen_offset;
void (*sv_onexec_old)(struct thread *td);
int (*sv_onexec)(struct proc *, struct image_params *);
+ void (*sv_protect)(struct image_params *, int);
void (*sv_onexit)(struct proc *);
void (*sv_ontdexit)(struct thread *td);
int (*sv_setid_allowed)(struct thread *td,
@@ -187,6 +188,10 @@
#define SVC_NOCOMPRESS 0x00000002 /* disable compression. */
#define SVC_ALL 0x00000004 /* dump everything */
+/* sv_protect flags */
+#define SVP_IMAGE 0x00000001
+#define SVP_INTERP 0x00000002
+
#ifdef _KERNEL
extern struct sysentvec aout_sysvec;
extern struct sysent sysent[];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 7:27 AM (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14530346
Default Alt Text
D42440.diff (1 KB)
Attached To
Mode
D42440: sysent: Add sv_protect
Attached
Detach File
Event Timeline
Log In to Comment