From: David van Moolenbroek Date: Sun, 24 Aug 2014 09:27:02 +0000 (+0000) Subject: VFS: provide correct root directory for lookups X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/d3.min.js?a=commitdiff_plain;h=refs%2Fchanges%2F40%2F2740%2F2;p=minix.git VFS: provide correct root directory for lookups This fixes a VFS panic and a chroot(2) security hole. Change-Id: Ifd1923f886501cf3a73277aab89db974798c47dc --- diff --git a/minix/servers/vfs/path.c b/minix/servers/vfs/path.c index 3ee444ea0..ffbc67d3d 100644 --- a/minix/servers/vfs/path.c +++ b/minix/servers/vfs/path.c @@ -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;