Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/fs/puffs Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/c72d5fb257c1
branches:  netbsd-6
changeset: 773974:c72d5fb257c1
user:      riz <riz%NetBSD.org@localhost>
date:      Tue Apr 03 15:57:50 2012 +0000

description:
Pull up following revision(s) (requested by jakllsch in ticket #154):
        sys/fs/puffs/puffs_vnops.c: revision 1.164
Prevent access beyond end of PUFFS file on read,
similar to as is done for NFS.

diffstat:

 sys/fs/puffs/puffs_vnops.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 252b2a0f11d2 -r c72d5fb257c1 sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c        Tue Apr 03 15:54:48 2012 +0000
+++ b/sys/fs/puffs/puffs_vnops.c        Tue Apr 03 15:57:50 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_vnops.c,v 1.163 2012/01/17 09:30:16 martin Exp $ */
+/*     $NetBSD: puffs_vnops.c,v 1.163.2.1 2012/04/03 15:57:50 riz Exp $        */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.163 2012/01/17 09:30:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.163.2.1 2012/04/03 15:57:50 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -1862,6 +1862,9 @@
                const int advice = IO_ADV_DECODE(ap->a_ioflag);
 
                while (uio->uio_resid > 0) {
+                       if (vp->v_size <= uio->uio_offset) {
+                               break;
+                       }
                        bytelen = MIN(uio->uio_resid,
                            vp->v_size - uio->uio_offset);
                        if (bytelen == 0)



Home | Main Index | Thread Index | Old Index