diff options
author | jhb <jhb@FreeBSD.org> | 2002-04-09 20:10:46 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-04-09 20:10:46 +0000 |
commit | 97bce5a40f6f17a0a765856fadc0df45dd5ee75f (patch) | |
tree | 888c25fcd0b8d42fbe2dc338809dbb338edc3251 /sys/kern/sys_process.c | |
parent | 6615797e535b58bbb6a5cd4a450b6634a80713a1 (diff) | |
download | FreeBSD-src-97bce5a40f6f17a0a765856fadc0df45dd5ee75f.zip FreeBSD-src-97bce5a40f6f17a0a765856fadc0df45dd5ee75f.tar.gz |
- Change fill_kinfo_proc() to require that the process is locked when it
is called.
- Change sysctl_out_proc() to require that the process is locked when it
is called and to drop the lock before it returns. If this proves too
complex we can change sysctl_out_proc() to simply acquire the lock at
the very end and have the calling code drop the lock right after it
returns.
- Lock the process we are going to export before the p_cansee() in the
loop in sysctl_kern_proc() and hold the lock until we call
sysctl_out_proc().
- Don't call p_cansee() on the process about to be exported twice in
the aforementioned loop.
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r-- | sys/kern/sys_process.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index a6780d4..ab830f3 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -488,7 +488,9 @@ ptrace(struct thread *td, struct ptrace_args *uap) } if (uap->addr != (caddr_t)1) { + PROC_LOCK(p); fill_kinfo_proc(p, &p->p_uarea->u_kproc); + PROC_UNLOCK(p); error = ptrace_set_pc(td2, (u_long)(uintfptr_t)uap->addr); if (error) { |