In revoke(), verify that VCHR vnode indeed belongs to devfs.

Found and tested by:	pho
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2010-07-06 18:20:49 +00:00
parent 864104fe59
commit aa81ae08e9

View File

@ -4215,7 +4215,7 @@ revoke(td, uap)
vfslocked = NDHASGIANT(&nd);
vp = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
if (vp->v_type != VCHR) {
if (vp->v_type != VCHR || vp->v_rdev == NULL) {
error = EINVAL;
goto out;
}