Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/proc.h
Show First 20 Lines • Show All 807 Lines • ▼ Show 20 Lines | |||||
#define P_PPTRACE 0x80000000 /* PT_TRACEME by vforked child. */ | #define P_PPTRACE 0x80000000 /* PT_TRACEME by vforked child. */ | ||||
#define P_STOPPED (P_STOPPED_SIG|P_STOPPED_SINGLE|P_STOPPED_TRACE) | #define P_STOPPED (P_STOPPED_SIG|P_STOPPED_SINGLE|P_STOPPED_TRACE) | ||||
#define P_SHOULDSTOP(p) ((p)->p_flag & P_STOPPED) | #define P_SHOULDSTOP(p) ((p)->p_flag & P_STOPPED) | ||||
#define P_KILLED(p) ((p)->p_flag & P_WKILLED) | #define P_KILLED(p) ((p)->p_flag & P_WKILLED) | ||||
/* These flags are kept in p_flag2. */ | /* These flags are kept in p_flag2. */ | ||||
#define P2_INHERIT_PROTECTED 0x00000001 /* New children get | #define P2_INHERIT_PROTECTED 0x00000001 /* New children get | ||||
P_PROTECTED. */ | P_PROTECTED. */ | ||||
kib: Comment is certainly wrong.
Why is this flag needed ? It seems that you set p_procdesc to… | |||||
Done Inline ActionsI'm wasn't sure if this a right approach but I want to remove a RCE. We can't kill the process in this time because we would create an process descriptor at this time. So I'm assumed just to this allow that. oshogbo: I'm wasn't sure if this a right approach but I want to remove a RCE.
We pdforked which creates… | |||||
#define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or | #define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or | ||||
coredumps. */ | coredumps. */ | ||||
#define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on | #define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on | ||||
exec(2). */ | exec(2). */ | ||||
#define P2_AST_SU 0x00000008 /* Handles SU ast for | #define P2_AST_SU 0x00000008 /* Handles SU ast for | ||||
kthreads. */ | kthreads. */ | ||||
#define P2_PTRACE_FSTP 0x00000010 /* SIGSTOP from PT_ATTACH not | #define P2_PTRACE_FSTP 0x00000010 /* SIGSTOP from PT_ATTACH not | ||||
yet handled. */ | yet handled. */ | ||||
#define P2_TRAPCAP 0x00000020 /* SIGTRAP on ENOTCAPABLE */ | #define P2_TRAPCAP 0x00000020 /* SIGTRAP on ENOTCAPABLE */ | ||||
#define P2_ASLR_ENABLE 0x00000040 /* Force enable ASLR. */ | #define P2_ASLR_ENABLE 0x00000040 /* Force enable ASLR. */ | ||||
#define P2_ASLR_DISABLE 0x00000080 /* Force disable ASLR. */ | #define P2_ASLR_DISABLE 0x00000080 /* Force disable ASLR. */ | ||||
#define P2_ASLR_IGNSTART 0x00000100 /* Enable ASLR to consume sbrk | #define P2_ASLR_IGNSTART 0x00000100 /* Enable ASLR to consume sbrk | ||||
area. */ | area. */ | ||||
#define P2_PROTMAX_ENABLE 0x00000200 /* Force enable implied | #define P2_PROTMAX_ENABLE 0x00000200 /* Force enable implied | ||||
PROT_MAX. */ | PROT_MAX. */ | ||||
#define P2_PROTMAX_DISABLE 0x00000400 /* Force disable implied | #define P2_PROTMAX_DISABLE 0x00000400 /* Force disable implied | ||||
PROT_MAX. */ | PROT_MAX. */ | ||||
#define P2_STKGAP_DISABLE 0x00000800 /* Disable stack gap for | #define P2_STKGAP_DISABLE 0x00000800 /* Disable stack gap for | ||||
MAP_STACK */ | MAP_STACK */ | ||||
#define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled | #define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled | ||||
after exec */ | after exec */ | ||||
#define P2_ITSTOPPED 0x00002000 | #define P2_ITSTOPPED 0x00002000 | ||||
#define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ | #define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ | ||||
#define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ | #define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ | ||||
#define P2_PDFORK 0x00010000 /* Process is pdforked and | |||||
* parent is there */ | |||||
/* Flags protected by proctree_lock, kept in p_treeflags. */ | /* Flags protected by proctree_lock, kept in p_treeflags. */ | ||||
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ | #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ | ||||
#define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan | #define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan | ||||
list */ | list */ | ||||
#define P_TREE_REAPER 0x00000004 /* Reaper of subtree */ | #define P_TREE_REAPER 0x00000004 /* Reaper of subtree */ | ||||
#define P_TREE_GRPEXITED 0x00000008 /* exit1() done with job ctl */ | #define P_TREE_GRPEXITED 0x00000008 /* exit1() done with job ctl */ | ||||
▲ Show 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | |||||
void kern_yield(int); | void kern_yield(int); | ||||
void kick_proc0(void); | void kick_proc0(void); | ||||
void killjobc(void); | void killjobc(void); | ||||
int leavepgrp(struct proc *p); | int leavepgrp(struct proc *p); | ||||
int maybe_preempt(struct thread *td); | int maybe_preempt(struct thread *td); | ||||
void maybe_yield(void); | void maybe_yield(void); | ||||
void mi_switch(int flags); | void mi_switch(int flags); | ||||
int p_candebug(struct thread *td, struct proc *p); | int p_candebug(struct thread *td, struct proc *p); | ||||
int p_cangetpd(struct thread *td, struct proc *p); | |||||
int p_cansee(struct thread *td, struct proc *p); | int p_cansee(struct thread *td, struct proc *p); | ||||
int p_cansched(struct thread *td, struct proc *p); | int p_cansched(struct thread *td, struct proc *p); | ||||
int p_cansignal(struct thread *td, struct proc *p, int signum); | int p_cansignal(struct thread *td, struct proc *p, int signum); | ||||
int p_canwait(struct thread *td, struct proc *p); | int p_canwait(struct thread *td, struct proc *p); | ||||
struct pargs *pargs_alloc(int len); | struct pargs *pargs_alloc(int len); | ||||
void pargs_drop(struct pargs *pa); | void pargs_drop(struct pargs *pa); | ||||
void pargs_hold(struct pargs *pa); | void pargs_hold(struct pargs *pa); | ||||
int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb); | int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb); | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |
Comment is certainly wrong.
Why is this flag needed ? It seems that you set p_procdesc to NULL and set the flag under the same region of the proc_lock.