1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

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.
This commit is contained in:
David Schultz 2004-10-01 05:01:17 +00:00
parent 46ec41ecb4
commit 616b5f90d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136004
3 changed files with 3 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;