diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2003-04-25 20:02:16 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2003-04-25 20:02:16 +0000 |
| commit | 17b8a8a77aad24178e63b0ea931048a1ca22a381 (patch) | |
| tree | 4f943820003e917487290c0af539dfd51c7c423e /sys/kern/sys_process.c | |
| parent | 25d6dc0606470be1c9d44a13f2e17fdc5909fd36 (diff) | |
Notes
Diffstat (limited to 'sys/kern/sys_process.c')
| -rw-r--r-- | sys/kern/sys_process.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index b12d8a1c8eb5d..c281cee6fe9c1 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -321,6 +321,9 @@ struct ptrace_args { }; #endif +/* + * MPSAFE + */ int ptrace(struct thread *td, struct ptrace_args *uap) { @@ -627,7 +630,9 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) uio.uio_segflg = UIO_SYSSPACE; /* i.e.: the uap */ uio.uio_rw = write ? UIO_WRITE : UIO_READ; uio.uio_td = td; + mtx_lock(&Giant); error = proc_rwmem(p, &uio); + mtx_unlock(&Giant); if (uio.uio_resid != 0) { /* * XXX proc_rwmem() doesn't currently return ENOSPC, @@ -668,7 +673,9 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) default: return (EINVAL); } + mtx_lock(&Giant); error = proc_rwmem(p, &uio); + mtx_unlock(&Giant); piod->piod_len -= uio.uio_resid; return (error); |
