summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2004-10-01 05:01:17 +0000
committerdas <das@FreeBSD.org>2004-10-01 05:01:17 +0000
commit9d2cf40e6309c36b8bd2cf35e45478f451dd1f19 (patch)
treef12684e02f8b31f99eecd09a02dd46cdeeb0121f
parent81fc7cf4858181b5112087c818ade372e1a94828 (diff)
downloadFreeBSD-src-9d2cf40e6309c36b8bd2cf35e45478f451dd1f19.zip
FreeBSD-src-9d2cf40e6309c36b8bd2cf35e45478f451dd1f19.tar.gz
Don't PHOLD() the target process in procfs, since this is already done
in pseudofs. Moreover, PHOLD() may block between the p_candebug() access check and the actual operation.
-rw-r--r--sys/fs/procfs/procfs_dbregs.c3
-rw-r--r--sys/fs/procfs/procfs_fpregs.c3
-rw-r--r--sys/fs/procfs/procfs_regs.c3
3 files changed, 3 insertions, 6 deletions
diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c
index 17fb4e8..0e129bb 100644
--- a/sys/fs/procfs/procfs_dbregs.c
+++ b/sys/fs/procfs/procfs_dbregs.c
@@ -63,12 +63,12 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
struct dbreg r;
PROC_LOCK(p);
+ KASSERT(p->p_lock > 0, ("proc not held"));
if (p_candebug(td, p) != 0) {
PROC_UNLOCK(p);
return (EPERM);
}
- _PHOLD(p);
/* XXXKSE: */
error = proc_read_dbregs(FIRST_THREAD_IN_PROC(p), &r);
if (error == 0) {
@@ -83,7 +83,6 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
/* XXXKSE: */
error = proc_write_dbregs(FIRST_THREAD_IN_PROC(p), &r);
}
- _PRELE(p);
PROC_UNLOCK(p);
uio->uio_offset = 0;
diff --git a/sys/fs/procfs/procfs_fpregs.c b/sys/fs/procfs/procfs_fpregs.c
index 9d10714..93356ce 100644
--- a/sys/fs/procfs/procfs_fpregs.c
+++ b/sys/fs/procfs/procfs_fpregs.c
@@ -57,12 +57,12 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
struct fpreg r;
PROC_LOCK(p);
+ KASSERT(p->p_lock > 0, ("proc not held"));
if (p_candebug(td, p)) {
PROC_UNLOCK(p);
return (EPERM);
}
- _PHOLD(p);
/* XXXKSE: */
error = proc_read_fpregs(FIRST_THREAD_IN_PROC(p), &r);
if (error == 0) {
@@ -77,7 +77,6 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
/* XXXKSE: */
error = proc_write_fpregs(FIRST_THREAD_IN_PROC(p), &r);
}
- _PRELE(p);
PROC_UNLOCK(p);
uio->uio_offset = 0;
diff --git a/sys/fs/procfs/procfs_regs.c b/sys/fs/procfs/procfs_regs.c
index a59e9bd..7da0f8c 100644
--- a/sys/fs/procfs/procfs_regs.c
+++ b/sys/fs/procfs/procfs_regs.c
@@ -57,12 +57,12 @@ procfs_doprocregs(PFS_FILL_ARGS)
struct reg r;
PROC_LOCK(p);
+ KASSERT(p->p_lock > 0, ("proc not held"));
if (p_candebug(td, p)) {
PROC_UNLOCK(p);
return (EPERM);
}
- _PHOLD(p);
/* XXXKSE: */
error = proc_read_regs(FIRST_THREAD_IN_PROC(p), &r);
if (error == 0) {
@@ -77,7 +77,6 @@ procfs_doprocregs(PFS_FILL_ARGS)
/* XXXKSE: */
error = proc_write_regs(FIRST_THREAD_IN_PROC(p), &r);
}
- _PRELE(p);
PROC_UNLOCK(p);
uio->uio_offset = 0;
OpenPOWER on IntegriCloud