Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/7f8c5b63c57a
branches:  netbsd-6-0
changeset: 774942:7f8c5b63c57a
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed May 21 21:06:36 2014 +0000

description:
Pull up following revision(s) (requested by martin in ticket #1062):
        sys/fs/cd9660/cd9660_node.c: revision 1.31
PR kern/48787: inode calculation from ISO9660 block offset might get
truncated to 32bit - force the whole expression to be evaluated as ino_t.
Patch from Thomas Schmitt, with minor modifications (and reworded comment).

diffstat:

 sys/fs/cd9660/cd9660_node.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r efe8a6ad0563 -r 7f8c5b63c57a sys/fs/cd9660/cd9660_node.c
--- a/sys/fs/cd9660/cd9660_node.c       Wed May 21 20:29:11 2014 +0000
+++ b/sys/fs/cd9660/cd9660_node.c       Wed May 21 21:06:36 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_node.c,v 1.29 2011/06/12 03:35:52 rmind Exp $   */
+/*     $NetBSD: cd9660_node.c,v 1.29.14.1 2014/05/21 21:06:36 bouyer Exp $     */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1994
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.29 2011/06/12 03:35:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.29.14.1 2014/05/21 21:06:36 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -438,7 +438,14 @@
 {
        ino_t ino;
 
-       ino = (isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length))
-             << imp->im_bshift;
-       return (ino);
+       /*
+        * Note there is an inverse calculation in
+        * cd9660_vfsops.c:cd9660_vget_internal():
+        *   ip->iso_start = ino >> imp->im_bshift;
+        * and also a calculation of the isodir pointer
+        * from an inode in cd9660_vnops.c:cd9660_readlink()
+        */
+       ino = ((ino_t)isonum_733(isodir->extent) +
+               isonum_711(isodir->ext_attr_length)) << imp->im_bshift;
+       return ino;
 }



Home | Main Index | Thread Index | Old Index