Date: Mon, 19 Dec 2022 16:50:35 GMT From: Doug Rabson <dfr@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 71e9be1bd54c - main - Don't allow stacking of file mounts Message-ID: <202212191650.2BJGoZfc094568@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=71e9be1bd54cf54de6fa273af71468e790ccdf47 commit 71e9be1bd54cf54de6fa273af71468e790ccdf47 Author: Doug Rabson <dfr@FreeBSD.org> AuthorDate: 2022-12-06 13:24:55 +0000 Commit: Doug Rabson <dfr@FreeBSD.org> CommitDate: 2022-12-19 16:46:27 +0000 Don't allow stacking of file mounts Reviewed by: mjg, kib Tested by: pho --- sys/kern/vfs_mount.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8de9d3c4fff8..67a72f095786 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1551,6 +1551,12 @@ vfs_domount( if (error != 0) return (error); vp = nd.ni_vp; + /* + * Don't allow stacking file mounts to work around problems with the way + * that namei sets nd.ni_dvp to vp_crossmp for these. + */ + if (vp->v_type == VREG) + fsflags |= MNT_NOCOVER; if ((fsflags & MNT_UPDATE) == 0) { if ((vp->v_vflag & VV_ROOT) != 0 && (fsflags & MNT_NOCOVER) != 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202212191650.2BJGoZfc094568>