Before using VTONULL(), check that the covered vnode belongs to nullfs.
Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
930cc2dbef
commit
25728e8411
@ -145,10 +145,13 @@ nullfs_mount(struct mount *mp)
|
||||
/*
|
||||
* Check multi null mount to avoid `lock against myself' panic.
|
||||
*/
|
||||
if (lowerrootvp == VTONULL(mp->mnt_vnodecovered)->null_lowervp) {
|
||||
NULLFSDEBUG("nullfs_mount: multi null mount?\n");
|
||||
vput(lowerrootvp);
|
||||
return (EDEADLK);
|
||||
if (mp->mnt_vnodecovered->v_op == &null_vnodeops) {
|
||||
nn = VTONULL(mp->mnt_vnodecovered);
|
||||
if (nn == NULL || lowerrootvp == nn->null_lowervp) {
|
||||
NULLFSDEBUG("nullfs_mount: multi null mount?\n");
|
||||
vput(lowerrootvp);
|
||||
return (EDEADLK);
|
||||
}
|
||||
}
|
||||
|
||||
xmp = (struct null_mount *) malloc(sizeof(struct null_mount),
|
||||
|
Loading…
Reference in New Issue
Block a user