nullfs: do not allow to mount a vnode over itself
This causes recursion in VFS that is not worth handling. PR: 275570 Reported by: Alex S <iwtcex@gmail.com> Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57043
This commit is contained in:
@@ -151,6 +151,14 @@ nullfs_mount(struct mount *mp)
|
|||||||
*/
|
*/
|
||||||
lowerrootvp = ndp->ni_vp;
|
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.
|
* Check multi null mount to avoid `lock against myself' panic.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user