summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs/devfs_vfsops.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-07-31 15:45:16 +0000
committerrwatson <rwatson@FreeBSD.org>2002-07-31 15:45:16 +0000
commit751f2d0c51ea2bbdb1625338052d19ecbb5f9f26 (patch)
treeed4ec9c3ffc090c01937ac072f89167be5573552 /sys/fs/devfs/devfs_vfsops.c
parentd829fd90ded403dd4a4a677af12efeec9fef680d (diff)
downloadFreeBSD-src-751f2d0c51ea2bbdb1625338052d19ecbb5f9f26.zip
FreeBSD-src-751f2d0c51ea2bbdb1625338052d19ecbb5f9f26.tar.gz
Introduce support for Mandatory Access Control and extensible
kernel access control. Instrument devfs to support per-dirent MAC labels. In particular, invoke MAC framework when devfs directory entries are instantiated due to make_dev() and related calls, and invoke the MAC framework when vnodes are instantiated from these directory entries. Implement vop_setlabel() for devfs, which pushes the label update into the devfs directory entry for semi-persistant store. This permits the MAC framework to assign labels to devices and directories as they are instantiated, and export access control information via devfs vnodes. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/fs/devfs/devfs_vfsops.c')
-rw-r--r--sys/fs/devfs/devfs_vfsops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c
index a46b0c4..00ad137 100644
--- a/sys/fs/devfs/devfs_vfsops.c
+++ b/sys/fs/devfs/devfs_vfsops.c
@@ -35,12 +35,14 @@
*/
#include "opt_devfs.h"
+#include "opt_mac.h"
#ifndef NODEVFS
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/lock.h>
+#include <sys/mac.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/proc.h>
@@ -83,6 +85,9 @@ devfs_mount(mp, ndp, td)
lockinit(&fmp->dm_lock, PVFS, "devfs", 0, LK_NOPAUSE);
mp->mnt_flag |= MNT_LOCAL;
+#ifdef MAC
+ mp->mnt_flag |= MNT_MULTILABEL;
+#endif
mp->mnt_data = (qaddr_t) fmp;
vfs_getnewfsid(mp);
@@ -90,6 +95,9 @@ devfs_mount(mp, ndp, td)
fmp->dm_rootdir = devfs_vmkdir("(root)", 6, NULL);
fmp->dm_rootdir->de_inode = 2;
+#ifdef MAC
+ mac_create_devfs_directory("", 0, fmp->dm_rootdir);
+#endif
fmp->dm_basedir = fmp->dm_rootdir;
devfs_rules_newmount(fmp, td);
OpenPOWER on IntegriCloud