Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_exec.c
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
#include <sys/imgact_elf.h> | #include <sys/imgact_elf.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mman.h> | #include <sys/mman.h> | ||||
#include <sys/mount.h> | #include <sys/mount.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/namei.h> | #include <sys/namei.h> | ||||
#include <sys/pioctl.h> | |||||
#include <sys/priv.h> | #include <sys/priv.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/ptrace.h> | #include <sys/ptrace.h> | ||||
#include <sys/resourcevar.h> | #include <sys/resourcevar.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/sched.h> | #include <sys/sched.h> | ||||
#include <sys/sdt.h> | #include <sys/sdt.h> | ||||
#include <sys/sf_buf.h> | #include <sys/sf_buf.h> | ||||
▲ Show 20 Lines • Show All 844 Lines • ▼ Show 20 Lines | exec_fail_dealloc: | ||||
if (error == 0) { | if (error == 0) { | ||||
if (p->p_ptevents & PTRACE_EXEC) { | if (p->p_ptevents & PTRACE_EXEC) { | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
if (p->p_ptevents & PTRACE_EXEC) | if (p->p_ptevents & PTRACE_EXEC) | ||||
td->td_dbgflags |= TDB_EXEC; | td->td_dbgflags |= TDB_EXEC; | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
} | } | ||||
/* | |||||
* Stop the process here if its stop event mask has | |||||
* the S_EXEC bit set. | |||||
*/ | |||||
STOPEVENT(p, S_EXEC, 0); | |||||
} else { | } else { | ||||
exec_fail: | exec_fail: | ||||
/* we're done here, clear P_INEXEC */ | /* we're done here, clear P_INEXEC */ | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
p->p_flag &= ~P_INEXEC; | p->p_flag &= ~P_INEXEC; | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
SDT_PROBE1(proc, , , exec__failure, error); | SDT_PROBE1(proc, , , exec__failure, error); | ||||
▲ Show 20 Lines • Show All 906 Lines • Show Last 20 Lines |