diff options
author | des <des@FreeBSD.org> | 2001-10-27 11:11:25 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-10-27 11:11:25 +0000 |
commit | 6f69985e93c752e175036d79097afa859dfd8465 (patch) | |
tree | a66faa22af38a5039764d0c1057f2cd8ddb2a25d /sys/kern/kern_prot.c | |
parent | c014a2100f6c28036d86039ae0b0bbf29cb841ab (diff) | |
download | FreeBSD-src-6f69985e93c752e175036d79097afa859dfd8465.zip FreeBSD-src-6f69985e93c752e175036d79097afa859dfd8465.tar.gz |
Add a P_INEXEC flag that indicates that the process has called execve() and
it has not yet returned. Use this flag to deny debugging requests while
the process is execve()ing, and close once and for all any race conditions
that might occur between execve() and various debugging interfaces.
Reviewed by: jhb, rwatson
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r-- | sys/kern/kern_prot.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 894efac..11917b4 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1569,6 +1569,10 @@ p_candebug(struct proc *p1, struct proc *p2) return (error); } + /* can't trace a process that's currently exec'ing */ + if ((p2->p_flag & P_INEXEC) != 0) + return (EAGAIN); + return (0); } |