aboutsummaryrefslogtreecommitdiffstats
path: root/sys/miscfs/procfs/procfs_fpregs.c
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2002-01-23 23:05:54 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2002-01-23 23:05:54 +0000
commite4f98b94ab090ec7c65667937e46c8a78810636f (patch)
treee8530ffc8e7137a26d1e2e92206ac5e38fb32e92 /sys/miscfs/procfs/procfs_fpregs.c
parent5d95e0d37d9f5883142ad02af75f30255c82e1d1 (diff)
downloadsrc-e4f98b94ab090ec7c65667937e46c8a78810636f.tar.gz
src-e4f98b94ab090ec7c65667937e46c8a78810636f.zip
Eliminate ptrace/exec race.
MFC 1.191 src/sys/sys/proc.h MFC 1.44 src/sys/kern/kern_exec.c (execve) Add P_INEXEC flag to indicate that a process is currently exec'ing. sys/kern/sys_process.c (ptrace) sys/miscfs/procfs/... Do not allow debugging of a process during exec.
Notes
Notes: svn path=/releng/4.4/; revision=89719
Diffstat (limited to 'sys/miscfs/procfs/procfs_fpregs.c')
-rw-r--r--sys/miscfs/procfs/procfs_fpregs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/miscfs/procfs/procfs_fpregs.c b/sys/miscfs/procfs/procfs_fpregs.c
index cd5fa7426fe6..7074148cfbfc 100644
--- a/sys/miscfs/procfs/procfs_fpregs.c
+++ b/sys/miscfs/procfs/procfs_fpregs.c
@@ -59,6 +59,9 @@ procfs_dofpregs(curp, p, pfs, uio)
char *kv;
int kl;
+ /* Can't trace a process that's currently exec'ing. */
+ if ((p->p_flag & P_INEXEC) != 0)
+ return EAGAIN;
if (!CHECKIO(curp, p) || p_trespass(curp, p))
return EPERM;
kl = sizeof(r);