diff options
author | simon <simon@FreeBSD.org> | 2005-07-20 13:34:16 +0000 |
---|---|---|
committer | simon <simon@FreeBSD.org> | 2005-07-20 13:34:16 +0000 |
commit | dd09386bedff6cb5e56b8298a68fdc48c6ceb902 (patch) | |
tree | 48bcf54729c2d392c579772253c678b9faefc6a9 /sys/fs | |
parent | 530b53493c55aa08d578d9fe884cbb1f80b79296 (diff) | |
download | FreeBSD-src-dd09386bedff6cb5e56b8298a68fdc48c6ceb902.zip FreeBSD-src-dd09386bedff6cb5e56b8298a68fdc48c6ceb902.tar.gz |
Correct devfs ruleset bypass.
Submitted by: csjp
Reviewed by: phk
Security: FreeBSD-SA-05:17.devfs
Approved by: cperciva
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index b03498f..34e78d9 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -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); |