Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/miscfs/kernfs Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/1965df10c008
branches:  netbsd-2-0
changeset: 564909:1965df10c008
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Nov 29 12:36:19 2005 +0000

description:
Pull up following revision(s) (requested by christos in ticket #10155):
        sys/miscfs/kernfs/kernfs_vnops.c: revision 1.114 via patch
Fix 64 bit truncation problem reported by http://www.securitylab.net

diffstat:

 sys/miscfs/kernfs/kernfs_vnops.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 31d7f6f18ef5 -r 1965df10c008 sys/miscfs/kernfs/kernfs_vnops.c
--- a/sys/miscfs/kernfs/kernfs_vnops.c  Mon Nov 14 22:35:14 2005 +0000
+++ b/sys/miscfs/kernfs/kernfs_vnops.c  Tue Nov 29 12:36:19 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernfs_vnops.c,v 1.98.2.6 2005/09/01 17:53:25 riz Exp $        */
+/*     $NetBSD: kernfs_vnops.c,v 1.98.2.7 2005/11/29 12:36:19 tron Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.98.2.6 2005/09/01 17:53:25 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.98.2.7 2005/11/29 12:36:19 tron Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -931,18 +931,18 @@
        struct uio *uio = ap->a_uio;
        struct kernfs_node *kfs = VTOKERN(ap->a_vp);
        char strbuf[KSTRING], *buf;
-       off_t off;
+       int off;
        size_t len;
        int error;
 
        if (ap->a_vp->v_type == VDIR)
                return (EOPNOTSUPP);
 
+       off = (int)uio->uio_offset;
        /* Don't allow negative offsets */
-       if (uio->uio_offset < 0)
+       if (off < 0)
                return EINVAL;
 
-       off = uio->uio_offset;
        buf = strbuf;
        if ((error = kernfs_xread(kfs, off, &buf, sizeof(strbuf), &len)) == 0)
                error = uiomove(buf, len, uio);



Home | Main Index | Thread Index | Old Index