From e521b5288a138ee222ed1c3cd1ad68bc0fcdbf1a Mon Sep 17 00:00:00 2001 From: Peter Holm Date: Fri, 9 Mar 2012 17:19:50 +0000 Subject: [PATCH] Revert r232692 as the correct place to fix this is at the syscall level. --- sys/ufs/ffs/ffs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 5535855bbe4c..9e8648e85035 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -464,11 +464,11 @@ ffs_read(ap) } else if (vp->v_type != VREG && vp->v_type != VDIR) panic("ffs_read: type %d", vp->v_type); #endif - if (uio->uio_resid < 0 || uio->uio_offset < 0) - return (EINVAL); orig_resid = uio->uio_resid; + KASSERT(orig_resid >= 0, ("ffs_read: uio->uio_resid < 0")); if (orig_resid == 0) return (0); + KASSERT(uio->uio_offset >= 0, ("ffs_read: uio->uio_offset < 0")); fs = ip->i_fs; if (uio->uio_offset < ip->i_size && uio->uio_offset >= fs->fs_maxfilesize)