aboutsummaryrefslogtreecommitdiffstats
path: root/sys/miscfs/procfs/procfs_dbregs.c
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2003-10-03 13:07:38 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2003-10-03 13:07:38 +0000
commit13bba0f1a042803c0d4e5135d0d34ae838a3f9c3 (patch)
tree903d1ccf3f7820a73e1814c045e67c9f2a44c552 /sys/miscfs/procfs/procfs_dbregs.c
parent2dedd3f3699b615fdeabd02fe6544ad15764db9d (diff)
downloadsrc-13bba0f1a042803c0d4e5135d0d34ae838a3f9c3.tar.gz
src-13bba0f1a042803c0d4e5135d0d34ae838a3f9c3.zip
Merge from RELENG_4: kern_subr.c 1.31.2.3, procfs_dbregs.c 1.4.2.4,
procfs_fpregs.c 1.11.2.4, procfs_regs.c 1.10.2.4, procfs_rlimit.c 1.5.2.1, procfs_status.c 1.20.2.5, uio.h 1.11.2.2, linprocfs_misc.c 1.3.2.9. Correct several integer underflows/overflows in procfs and linprocfs.
Notes
Notes: svn path=/releng/4.4/; revision=120689
Diffstat (limited to 'sys/miscfs/procfs/procfs_dbregs.c')
-rw-r--r--sys/miscfs/procfs/procfs_dbregs.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/sys/miscfs/procfs/procfs_dbregs.c b/sys/miscfs/procfs/procfs_dbregs.c
index 9fe4968d37c6..971c09eb0af7 100644
--- a/sys/miscfs/procfs/procfs_dbregs.c
+++ b/sys/miscfs/procfs/procfs_dbregs.c
@@ -59,30 +59,17 @@ procfs_dodbregs(curp, p, pfs, uio)
{
int error;
struct dbreg r;
- char *kv;
- int kl;
/* Can't trace a process that's currently exec'ing. */
if ((p->p_flag & P_INEXEC) != 0)
return EAGAIN;
if (!CHECKIO(curp, p) || p_trespass(curp, p))
return (EPERM);
- kl = sizeof(r);
- kv = (char *) &r;
-
- kv += uio->uio_offset;
- kl -= uio->uio_offset;
- if (kl > uio->uio_resid)
- kl = uio->uio_resid;
PHOLD(p);
-
- if (kl < 0)
- error = EINVAL;
- else
- error = procfs_read_dbregs(p, &r);
+ error = procfs_read_dbregs(p, &r);
if (error == 0)
- error = uiomove(kv, kl, uio);
+ error = uiomove_frombuf(&r, sizeof(r), uio);
if (error == 0 && uio->uio_rw == UIO_WRITE) {
if (p->p_stat != SSTOP)
error = EBUSY;