mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
o Call the functions registered with at_exec() from exec_new_vmspace()
instead of execve(). Otherwise, the possibility still exists for a pending AIO to modify the new address space. Reviewed by: alfred
This commit is contained in:
parent
4c6aff87c8
commit
6f5dafea75
@ -128,7 +128,6 @@ execve(td, uap)
|
||||
struct vattr attr;
|
||||
int (*img_first) __P((struct image_params *));
|
||||
struct pargs *pa;
|
||||
struct execlist *ep;
|
||||
|
||||
imgp = &image_params;
|
||||
|
||||
@ -258,9 +257,6 @@ interpret:
|
||||
goto interpret;
|
||||
}
|
||||
|
||||
TAILQ_FOREACH(ep, &exec_list, next)
|
||||
(*ep->function)(p);
|
||||
|
||||
/*
|
||||
* Copy out strings (args and env) and initialize stack base
|
||||
*/
|
||||
@ -584,6 +580,7 @@ exec_new_vmspace(imgp)
|
||||
struct image_params *imgp;
|
||||
{
|
||||
int error;
|
||||
struct execlist *ep;
|
||||
struct vmspace *vmspace = imgp->proc->p_vmspace;
|
||||
vm_offset_t stack_addr = USRSTACK - maxssiz;
|
||||
vm_map_t map = &vmspace->vm_map;
|
||||
@ -592,6 +589,12 @@ exec_new_vmspace(imgp)
|
||||
|
||||
imgp->vmspace_destroyed = 1;
|
||||
|
||||
/*
|
||||
* Perform functions registered with at_exec().
|
||||
*/
|
||||
TAILQ_FOREACH(ep, &exec_list, next)
|
||||
(*ep->function)(imgp->proc);
|
||||
|
||||
/*
|
||||
* Blow away entire process VM, if address space not shared,
|
||||
* otherwise, create a new VM space so that other threads are
|
||||
|
Loading…
Reference in New Issue
Block a user