Correct devfs ruleset bypass.

Submitted by:	csjp
Reviewed by:	phk
Security:	FreeBSD-SA-05:17.devfs
Approved by:	cperciva
This commit is contained in:
Simon L. B. Nielsen 2005-07-20 13:34:16 +00:00
parent 0e0fe87a70
commit 02a4be3f74

View file

@ -788,6 +788,12 @@ devfs_mknod(struct vop_mknod_args *ap)
struct devfs_mount *dmp;
int error;
/*
* The only type of node we should be creating here is a
* character device, for anything else return EOPNOTSUPP.
*/
if (ap->a_vap->va_type != VCHR)
return (EOPNOTSUPP);
dvp = ap->a_dvp;
dmp = VFSTODEVFS(dvp->v_mount);
lockmgr(&dmp->dm_lock, LK_EXCLUSIVE, 0, curthread);