aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/procfs/procfs_dbregs.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2007-04-15 13:24:03 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2007-04-15 13:24:03 +0000
commit66cd74a611b59e28f8078e5120346a280853773d (patch)
tree5706c178e936f3117fb4b3f995f299c12d73aaf1 /sys/fs/procfs/procfs_dbregs.c
parentf1d6e6dc7154b50a2720540d182833fb08ce7c1b (diff)
downloadsrc-66cd74a611b59e28f8078e5120346a280853773d.tar.gz
src-66cd74a611b59e28f8078e5120346a280853773d.zip
Don't reset uio_offset to 0 before returning. Instead, refuse to service
requests where uio_offset is not 0 to begin with. This fixes a long- standing bug where e.g. 'cat /proc/$$/regs' would loop forever. MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=168758
Diffstat (limited to 'sys/fs/procfs/procfs_dbregs.c')
-rw-r--r--sys/fs/procfs/procfs_dbregs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c
index c30f231c67a9..d985245528b9 100644
--- a/sys/fs/procfs/procfs_dbregs.c
+++ b/sys/fs/procfs/procfs_dbregs.c
@@ -95,6 +95,9 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
int wrap32 = 0;
#endif
+ if (uio->uio_offset != 0)
+ return (0);
+
PROC_LOCK(p);
KASSERT(p->p_lock > 0, ("proc not held"));
if (p_candebug(td, p) != 0) {
@@ -128,6 +131,5 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
}
PROC_UNLOCK(p);
- uio->uio_offset = 0;
return (error);
}