diff options
author | rwatson <rwatson@FreeBSD.org> | 2003-05-05 15:12:51 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2003-05-05 15:12:51 +0000 |
commit | f0516000a7c95b5ee3c5635735fd6284b20780c8 (patch) | |
tree | 9ad6dec1b793092dc34fb8685ed211b3fd0e055e /sys/fs/procfs/procfs_dbregs.c | |
parent | d6a0f92ee34493f8f6ed063509b8436ce6d81cc1 (diff) | |
download | FreeBSD-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_dbregs.c')
-rw-r--r-- | sys/fs/procfs/procfs_dbregs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c index 442521c..ae6e794 100644 --- a/sys/fs/procfs/procfs_dbregs.c +++ b/sys/fs/procfs/procfs_dbregs.c @@ -87,8 +87,11 @@ procfs_doprocdbregs(PFS_FILL_ARGS) else /* XXXKSE: */ error = proc_read_dbregs(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)) /* XXXKSE should be P_TRACED? */ error = EBUSY; |