summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs_fpregs.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-05-05 15:12:51 +0000
committerrwatson <rwatson@FreeBSD.org>2003-05-05 15:12:51 +0000
commitf0516000a7c95b5ee3c5635735fd6284b20780c8 (patch)
tree9ad6dec1b793092dc34fb8685ed211b3fd0e055e /sys/fs/procfs/procfs_fpregs.c
parentd6a0f92ee34493f8f6ed063509b8436ce6d81cc1 (diff)
downloadFreeBSD-src-f0516000a7c95b5ee3c5635735fd6284b20780c8.zip
FreeBSD-src-f0516000a7c95b5ee3c5635735fd6284b20780c8.tar.gz
Clean up proc locking in procfs: make sure the proc lock is held before
entering sys_process.c debugging primitives, or we violate assertions. Also, be more careful about releasing the process lock around calls to uiomove() which may sleep waiting for paging machinations or related notions. We may want to defer the uiomove() in at least one case, but jhb will look into that at a later date. Reported by: Philippe Charnier <charnier@xp11.frmug.org> Reviewed by: jhb
Diffstat (limited to 'sys/fs/procfs/procfs_fpregs.c')
-rw-r--r--sys/fs/procfs/procfs_fpregs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_fpregs.c b/sys/fs/procfs/procfs_fpregs.c
index f1401f3..b52f5ee 100644
--- a/sys/fs/procfs/procfs_fpregs.c
+++ b/sys/fs/procfs/procfs_fpregs.c
@@ -81,8 +81,11 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
else
/* XXXKSE: */
error = proc_read_fpregs(FIRST_THREAD_IN_PROC(p), &r);
- if (error == 0)
+ if (error == 0) {
+ PROC_UNLOCK(p);
error = uiomove(kv, kl, uio);
+ PROC_LOCK(p);
+ }
if (error == 0 && uio->uio_rw == UIO_WRITE) {
if (!P_SHOULDSTOP(p))
error = EBUSY;
OpenPOWER on IntegriCloud