]> Zhao Yanbai Git Server - minix.git/commitdiff
VFS: provide correct root directory for lookups 40/2740/2
authorDavid van Moolenbroek <david@minix3.org>
Sun, 24 Aug 2014 09:27:02 +0000 (09:27 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Thu, 18 Sep 2014 12:46:23 +0000 (12:46 +0000)
This fixes a VFS panic and a chroot(2) security hole.

Change-Id: Ifd1923f886501cf3a73277aab89db974798c47dc

minix/servers/vfs/path.c

index 3ee444ea077ecaf0f2a5348c28ffb2118fac712e..ffbc67d3d9ed0c635ae656ebc0486f3b5b0cb8c3 100644 (file)
@@ -430,7 +430,7 @@ struct fproc *rfp;
 
   /* Is the process' root directory on the same partition?,
    * if so, set the chroot directory too. */
-  if (rfp->fp_rd->v_dev == rfp->fp_wd->v_dev)
+  if (rfp->fp_rd->v_dev == start_node->v_dev)
        root_ino = rfp->fp_rd->v_inode_nr;
   else
        root_ino = 0;