From 15d16124c27c4ef7f603e2c4c45f95cceec5d782 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 6 Jul 2010 18:20:49 +0000 Subject: [PATCH] In revoke(), verify that VCHR vnode indeed belongs to devfs. Found and tested by: pho MFC after: 1 week --- sys/kern/vfs_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index ab0627d7bf22..4fd9dfa0e8f5 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -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; }