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/doc/syslog.conf.5.html?a=commitdiff_plain;h=e7b4aa7d99313d4fce05fc497a870819076f14ca;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;