Call sv_onexec hook after the process VA is created.

For future use in the Linux emulation layer call sv_onexec hook right after
the new process address space is created. It's safe, as sv_onexec used only
by Linux abi and linux_on_exec() does not depend on a state of process VA.

Reviewed by:		kib
Differential revision:	https://reviews.freebsd.org/D30899
MFC after:		2 weeks
This commit is contained in:
Dmitry Chagin 2021-07-20 09:55:14 +03:00
parent b39fa4770d
commit 62ba4cd340

View file

@ -1072,8 +1072,6 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv)
if (p->p_sysent->sv_onexec_old != NULL)
p->p_sysent->sv_onexec_old(td);
itimers_exec(p);
if (sv->sv_onexec != NULL)
sv->sv_onexec(p, imgp);
EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp);
@ -1165,6 +1163,8 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv)
vmspace->vm_ssize = sgrowsiz >> PAGE_SHIFT;
vmspace->vm_maxsaddr = (char *)stack_addr;
if (sv->sv_onexec != NULL)
sv->sv_onexec(p, imgp);
return (0);
}