VFS: provide correct root directory for lookups

This fixes a VFS panic and a chroot(2) security hole.

Change-Id: Ifd1923f886501cf3a73277aab89db974798c47dc
This commit is contained in:
David van Moolenbroek 2014-08-24 09:27:02 +00:00
parent 71cd1dd4b9
commit e7b4aa7d99

View 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;