The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b393aa8e30b5911a5177b6aaacd5a62beea8e3d6
commit b393aa8e30b5911a5177b6aaacd5a62beea8e3d6 Author: Konstantin Belousov <[email protected]> AuthorDate: 2026-05-16 22:16:45 +0000 Commit: Konstantin Belousov <[email protected]> CommitDate: 2026-05-23 06:56:13 +0000 nullfs: do not allow to mount a vnode over itself PR: 275570 (cherry picked from commit 7bdf2b5d5fbabfc8749c4ff6e618c3e843b14de0) --- sys/fs/nullfs/null_vfsops.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index c3eec727aeea..0ec4f9c87297 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -151,6 +151,14 @@ nullfs_mount(struct mount *mp) */ lowerrootvp = ndp->ni_vp; + /* + * Do not allow to mount a vnode over itself. + */ + if (mp->mnt_vnodecovered == lowerrootvp) { + vput(lowerrootvp); + return (EDEADLK); + } + /* * Check multi null mount to avoid `lock against myself' panic. */
