summaryrefslogtreecommitdiff
path: root/sys/miscfs/procfs/procfs_subr.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-05-05 23:52:11 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-05-05 23:52:11 +0000
commitc7bd171a110dc759928d58a928869b7e355969c2 (patch)
treeee7900fd3f27674c3f98e4cc4b2038b8fc2c7fe1 /sys/miscfs/procfs/procfs_subr.c
parent9fa54860a762e0b9de75773b73d02d619703f634 (diff)
make sure uio_offset is a safe value, with suggestions from millert@
ok deraadt@ millert@ problem noticed by deprotect.com
Diffstat (limited to 'sys/miscfs/procfs/procfs_subr.c')
-rw-r--r--sys/miscfs/procfs/procfs_subr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c
index 38723b253b4..a7f9ff5f06f 100644
--- a/sys/miscfs/procfs/procfs_subr.c
+++ b/sys/miscfs/procfs/procfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_subr.c,v 1.20 2003/08/11 10:08:04 mickey Exp $ */
+/* $OpenBSD: procfs_subr.c,v 1.21 2004/05/05 23:52:10 tedu Exp $ */
/* $NetBSD: procfs_subr.c,v 1.15 1996/02/12 15:01:42 christos Exp $ */
/*
@@ -214,6 +214,8 @@ procfs_rw(v)
/* Do not permit games to be played with init(8) */
if (p->p_pid == 1 && securelevel > 0 && uio->uio_rw == UIO_WRITE)
return (EPERM);
+ if (uio->uio_offset < 0)
+ return (EINVAL);
switch (pfs->pfs_type) {
case Pnote: