1 /* Updated: Karl MacMillan <kmacmillan@tresys.com>
3 * Added conditional policy language extensions
5 * Copyright (C) 2003 - 2004 Tresys Technology, LLC
6 * Copyright (C) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, version 2.
12 #include <linux/config.h>
13 #include <linux/kernel.h>
14 #include <linux/pagemap.h>
15 #include <linux/slab.h>
16 #include <linux/vmalloc.h>
18 #include <linux/init.h>
19 #include <linux/string.h>
20 #include <linux/security.h>
21 #include <linux/major.h>
22 #include <linux/seq_file.h>
23 #include <linux/percpu.h>
24 #include <asm/uaccess.h>
25 #include <asm/semaphore.h>
27 /* selinuxfs pseudo filesystem for exporting the security policy API.
28 Based on the proc code and the fs/nfsd/nfsctl.c code. */
35 #include "conditional.h"
37 static DECLARE_MUTEX(sel_sem);
39 /* global data for booleans */
40 static struct dentry *bool_dir = NULL;
41 static int bool_num = 0;
42 static int *bool_pending_values = NULL;
44 extern void selnl_notify_setenforce(int val);
46 /* Check whether a task is allowed to use a security operation. */
47 int task_has_security(struct task_struct *tsk,
50 struct task_security_struct *tsec;
56 return avc_has_perm(tsec->sid, SECINITSID_SECURITY,
57 SECCLASS_SECURITY, perms, NULL);
62 SEL_LOAD, /* load policy */
63 SEL_ENFORCE, /* get or set enforcing status */
64 SEL_CONTEXT, /* validate context */
65 SEL_ACCESS, /* compute access decision */
66 SEL_CREATE, /* compute create labeling decision */
67 SEL_RELABEL, /* compute relabeling decision */
68 SEL_USER, /* compute reachable user contexts */
69 SEL_POLICYVERS, /* return policy version for this kernel */
70 SEL_COMMIT_BOOLS, /* commit new boolean values */
71 SEL_MLS, /* return if MLS policy is enabled */
72 SEL_DISABLE, /* disable SELinux until next reboot */
73 SEL_AVC, /* AVC management directory */
77 static ssize_t sel_read_enforce(struct file *filp, char __user *buf,
78 size_t count, loff_t *ppos)
80 char tmpbuf[TMPBUFLEN];
83 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", selinux_enforcing);
84 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
87 #ifdef CONFIG_SECURITY_SELINUX_DEVELOP
88 static ssize_t sel_write_enforce(struct file * file, const char __user * buf,
89 size_t count, loff_t *ppos)
96 if (count < 0 || count >= PAGE_SIZE)
99 /* No partial writes. */
102 page = (char*)get_zeroed_page(GFP_KERNEL);
106 if (copy_from_user(page, buf, count))
110 if (sscanf(page, "%d", &new_value) != 1)
113 if (new_value != selinux_enforcing) {
114 length = task_has_security(current, SECURITY__SETENFORCE);
117 selinux_enforcing = new_value;
118 if (selinux_enforcing)
120 selnl_notify_setenforce(selinux_enforcing);
124 free_page((unsigned long) page);
128 #define sel_write_enforce NULL
131 static struct file_operations sel_enforce_ops = {
132 .read = sel_read_enforce,
133 .write = sel_write_enforce,
136 #ifdef CONFIG_SECURITY_SELINUX_DISABLE
137 static ssize_t sel_write_disable(struct file * file, const char __user * buf,
138 size_t count, loff_t *ppos)
144 extern int selinux_disable(void);
146 if (count < 0 || count >= PAGE_SIZE)
149 /* No partial writes. */
152 page = (char*)get_zeroed_page(GFP_KERNEL);
156 if (copy_from_user(page, buf, count))
160 if (sscanf(page, "%d", &new_value) != 1)
164 length = selinux_disable();
171 free_page((unsigned long) page);
175 #define sel_write_disable NULL
178 static struct file_operations sel_disable_ops = {
179 .write = sel_write_disable,
182 static ssize_t sel_read_policyvers(struct file *filp, char __user *buf,
183 size_t count, loff_t *ppos)
185 char tmpbuf[TMPBUFLEN];
188 length = scnprintf(tmpbuf, TMPBUFLEN, "%u", POLICYDB_VERSION_MAX);
189 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
192 static struct file_operations sel_policyvers_ops = {
193 .read = sel_read_policyvers,
196 /* declaration for sel_write_load */
197 static int sel_make_bools(void);
199 static ssize_t sel_read_mls(struct file *filp, char __user *buf,
200 size_t count, loff_t *ppos)
202 char tmpbuf[TMPBUFLEN];
205 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", selinux_mls_enabled);
206 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
209 static struct file_operations sel_mls_ops = {
210 .read = sel_read_mls,
213 static ssize_t sel_write_load(struct file * file, const char __user * buf,
214 size_t count, loff_t *ppos)
223 length = task_has_security(current, SECURITY__LOAD_POLICY);
228 /* No partial writes. */
233 if ((count < 0) || (count > 64 * 1024 * 1024)
234 || (data = vmalloc(count)) == NULL) {
240 if (copy_from_user(data, buf, count) != 0)
243 length = security_load_policy(data, count);
247 ret = sel_make_bools();
258 static struct file_operations sel_load_ops = {
259 .write = sel_write_load,
263 static ssize_t sel_write_context(struct file * file, const char __user * buf,
264 size_t count, loff_t *ppos)
271 length = task_has_security(current, SECURITY__CHECK_CONTEXT);
275 if (count < 0 || count >= PAGE_SIZE)
278 /* No partial writes. */
281 page = (char*)get_zeroed_page(GFP_KERNEL);
285 if (copy_from_user(page, buf, count))
288 length = security_context_to_sid(page, count, &sid);
294 free_page((unsigned long) page);
298 static struct file_operations sel_context_ops = {
299 .write = sel_write_context,
304 * Remaining nodes use transaction based IO methods like nfsd/nfsctl.c
306 static ssize_t sel_write_access(struct file * file, char *buf, size_t size);
307 static ssize_t sel_write_create(struct file * file, char *buf, size_t size);
308 static ssize_t sel_write_relabel(struct file * file, char *buf, size_t size);
309 static ssize_t sel_write_user(struct file * file, char *buf, size_t size);
311 static ssize_t (*write_op[])(struct file *, char *, size_t) = {
312 [SEL_ACCESS] = sel_write_access,
313 [SEL_CREATE] = sel_write_create,
314 [SEL_RELABEL] = sel_write_relabel,
315 [SEL_USER] = sel_write_user,
318 static ssize_t selinux_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos)
320 ino_t ino = file->f_dentry->d_inode->i_ino;
324 if (ino >= sizeof(write_op)/sizeof(write_op[0]) || !write_op[ino])
327 data = simple_transaction_get(file, buf, size);
329 return PTR_ERR(data);
331 rv = write_op[ino](file, data, size);
333 simple_transaction_set(file, rv);
339 static struct file_operations transaction_ops = {
340 .write = selinux_transaction_write,
341 .read = simple_transaction_read,
342 .release = simple_transaction_release,
346 * payload - write methods
347 * If the method has a response, the response should be put in buf,
348 * and the length returned. Otherwise return 0 or and -error.
351 static ssize_t sel_write_access(struct file * file, char *buf, size_t size)
357 struct av_decision avd;
360 length = task_has_security(current, SECURITY__COMPUTE_AV);
365 scon = kmalloc(size+1, GFP_KERNEL);
368 memset(scon, 0, size+1);
370 tcon = kmalloc(size+1, GFP_KERNEL);
373 memset(tcon, 0, size+1);
376 if (sscanf(buf, "%s %s %hu %x", scon, tcon, &tclass, &req) != 4)
379 length = security_context_to_sid(scon, strlen(scon)+1, &ssid);
382 length = security_context_to_sid(tcon, strlen(tcon)+1, &tsid);
386 length = security_compute_av(ssid, tsid, tclass, req, &avd);
390 length = scnprintf(buf, SIMPLE_TRANSACTION_LIMIT,
392 avd.allowed, avd.decided,
393 avd.auditallow, avd.auditdeny,
402 static ssize_t sel_write_create(struct file * file, char *buf, size_t size)
405 u32 ssid, tsid, newsid;
411 length = task_has_security(current, SECURITY__COMPUTE_CREATE);
416 scon = kmalloc(size+1, GFP_KERNEL);
419 memset(scon, 0, size+1);
421 tcon = kmalloc(size+1, GFP_KERNEL);
424 memset(tcon, 0, size+1);
427 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3)
430 length = security_context_to_sid(scon, strlen(scon)+1, &ssid);
433 length = security_context_to_sid(tcon, strlen(tcon)+1, &tsid);
437 length = security_transition_sid(ssid, tsid, tclass, &newsid);
441 length = security_sid_to_context(newsid, &newcon, &len);
445 if (len > SIMPLE_TRANSACTION_LIMIT) {
446 printk(KERN_ERR "%s: context size (%u) exceeds payload "
447 "max\n", __FUNCTION__, len);
452 memcpy(buf, newcon, len);
463 static ssize_t sel_write_relabel(struct file * file, char *buf, size_t size)
466 u32 ssid, tsid, newsid;
472 length = task_has_security(current, SECURITY__COMPUTE_RELABEL);
477 scon = kmalloc(size+1, GFP_KERNEL);
480 memset(scon, 0, size+1);
482 tcon = kmalloc(size+1, GFP_KERNEL);
485 memset(tcon, 0, size+1);
488 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3)
491 length = security_context_to_sid(scon, strlen(scon)+1, &ssid);
494 length = security_context_to_sid(tcon, strlen(tcon)+1, &tsid);
498 length = security_change_sid(ssid, tsid, tclass, &newsid);
502 length = security_sid_to_context(newsid, &newcon, &len);
506 if (len > SIMPLE_TRANSACTION_LIMIT) {
511 memcpy(buf, newcon, len);
522 static ssize_t sel_write_user(struct file * file, char *buf, size_t size)
524 char *con, *user, *ptr;
531 length = task_has_security(current, SECURITY__COMPUTE_USER);
536 con = kmalloc(size+1, GFP_KERNEL);
539 memset(con, 0, size+1);
541 user = kmalloc(size+1, GFP_KERNEL);
544 memset(user, 0, size+1);
547 if (sscanf(buf, "%s %s", con, user) != 2)
550 length = security_context_to_sid(con, strlen(con)+1, &sid);
554 length = security_get_user_sids(sid, user, &sids, &nsids);
558 length = sprintf(buf, "%u", nsids) + 1;
560 for (i = 0; i < nsids; i++) {
561 rc = security_sid_to_context(sids[i], &newcon, &len);
566 if ((length + len) >= SIMPLE_TRANSACTION_LIMIT) {
571 memcpy(ptr, newcon, len);
585 static struct inode *sel_make_inode(struct super_block *sb, int mode)
587 struct inode *ret = new_inode(sb);
591 ret->i_uid = ret->i_gid = 0;
592 ret->i_blksize = PAGE_CACHE_SIZE;
594 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
599 #define BOOL_INO_OFFSET 30
601 static ssize_t sel_read_bool(struct file *filep, char __user *buf,
602 size_t count, loff_t *ppos)
615 /* check to see if this file has been deleted */
619 if (count < 0 || count > PAGE_SIZE) {
623 if (!(page = (char*)get_zeroed_page(GFP_KERNEL))) {
628 inode = filep->f_dentry->d_inode;
629 cur_enforcing = security_get_bool_value(inode->i_ino - BOOL_INO_OFFSET);
630 if (cur_enforcing < 0) {
635 length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing,
636 bool_pending_values[inode->i_ino - BOOL_INO_OFFSET]);
642 if (*ppos >= length) {
646 if (count + *ppos > length)
647 count = length - *ppos;
649 if (copy_to_user(buf, (char *) page + *ppos, count)) {
658 free_page((unsigned long)page);
662 static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
663 size_t count, loff_t *ppos)
666 ssize_t length = -EFAULT;
672 length = task_has_security(current, SECURITY__SETBOOL);
676 /* check to see if this file has been deleted */
680 if (count < 0 || count >= PAGE_SIZE) {
685 /* No partial writes. */
688 page = (char*)get_zeroed_page(GFP_KERNEL);
694 if (copy_from_user(page, buf, count))
698 if (sscanf(page, "%d", &new_value) != 1)
704 inode = filep->f_dentry->d_inode;
705 bool_pending_values[inode->i_ino - BOOL_INO_OFFSET] = new_value;
711 free_page((unsigned long) page);
715 static struct file_operations sel_bool_ops = {
716 .read = sel_read_bool,
717 .write = sel_write_bool,
720 static ssize_t sel_commit_bools_write(struct file *filep,
721 const char __user *buf,
722 size_t count, loff_t *ppos)
725 ssize_t length = -EFAULT;
730 length = task_has_security(current, SECURITY__SETBOOL);
734 /* check to see if this file has been deleted */
738 if (count < 0 || count >= PAGE_SIZE) {
743 /* No partial writes. */
746 page = (char*)get_zeroed_page(GFP_KERNEL);
752 if (copy_from_user(page, buf, count))
756 if (sscanf(page, "%d", &new_value) != 1)
760 security_set_bools(bool_num, bool_pending_values);
768 free_page((unsigned long) page);
772 static struct file_operations sel_commit_bools_ops = {
773 .write = sel_commit_bools_write,
776 /* delete booleans - partial revoke() from
777 * fs/proc/generic.c proc_kill_inodes */
778 static void sel_remove_bools(struct dentry *de)
780 struct list_head *p, *node;
781 struct super_block *sb = de->d_sb;
783 spin_lock(&dcache_lock);
784 node = de->d_subdirs.next;
785 while (node != &de->d_subdirs) {
786 struct dentry *d = list_entry(node, struct dentry, d_child);
791 spin_unlock(&dcache_lock);
793 simple_unlink(de->d_inode, d);
795 spin_lock(&dcache_lock);
797 node = de->d_subdirs.next;
800 spin_unlock(&dcache_lock);
803 list_for_each(p, &sb->s_files) {
804 struct file * filp = list_entry(p, struct file, f_list);
805 struct dentry * dentry = filp->f_dentry;
807 if (dentry->d_parent != de) {
815 #define BOOL_DIR_NAME "booleans"
817 static int sel_make_bools(void)
821 struct dentry *dentry = NULL;
822 struct dentry *dir = bool_dir;
823 struct inode *inode = NULL;
824 struct inode_security_struct *isec;
825 char **names = NULL, *page;
830 /* remove any existing files */
831 if (bool_pending_values)
832 kfree(bool_pending_values);
834 sel_remove_bools(dir);
836 if (!(page = (char*)get_zeroed_page(GFP_KERNEL)))
839 ret = security_get_bools(&num, &names, &values);
843 for (i = 0; i < num; i++) {
844 dentry = d_alloc_name(dir, names[i]);
849 inode = sel_make_inode(dir->d_sb, S_IFREG | S_IRUGO | S_IWUSR);
855 len = snprintf(page, PAGE_SIZE, "/%s/%s", BOOL_DIR_NAME, names[i]);
859 } else if (len >= PAGE_SIZE) {
863 isec = (struct inode_security_struct*)inode->i_security;
864 if ((ret = security_genfs_sid("selinuxfs", page, SECCLASS_FILE, &sid)))
867 isec->initialized = 1;
868 inode->i_fop = &sel_bool_ops;
869 inode->i_ino = i + BOOL_INO_OFFSET;
870 d_add(dentry, inode);
873 bool_pending_values = values;
875 free_page((unsigned long)page);
877 for (i = 0; i < num; i++) {
890 #define NULL_FILE_NAME "null"
892 struct dentry *selinux_null = NULL;
894 static ssize_t sel_read_avc_cache_threshold(struct file *filp, char __user *buf,
895 size_t count, loff_t *ppos)
897 char tmpbuf[TMPBUFLEN];
900 length = scnprintf(tmpbuf, TMPBUFLEN, "%u", avc_cache_threshold);
901 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
904 static ssize_t sel_write_avc_cache_threshold(struct file * file,
905 const char __user * buf,
906 size_t count, loff_t *ppos)
913 if (count < 0 || count >= PAGE_SIZE) {
919 /* No partial writes. */
924 page = (char*)get_zeroed_page(GFP_KERNEL);
930 if (copy_from_user(page, buf, count)) {
935 if (sscanf(page, "%u", &new_value) != 1) {
940 if (new_value != avc_cache_threshold) {
941 ret = task_has_security(current, SECURITY__SETSECPARAM);
944 avc_cache_threshold = new_value;
948 free_page((unsigned long)page);
953 static ssize_t sel_read_avc_hash_stats(struct file *filp, char __user *buf,
954 size_t count, loff_t *ppos)
959 page = (char *)__get_free_page(GFP_KERNEL);
964 ret = avc_get_hash_stats(page);
966 ret = simple_read_from_buffer(buf, count, ppos, page, ret);
967 free_page((unsigned long)page);
972 static struct file_operations sel_avc_cache_threshold_ops = {
973 .read = sel_read_avc_cache_threshold,
974 .write = sel_write_avc_cache_threshold,
977 static struct file_operations sel_avc_hash_stats_ops = {
978 .read = sel_read_avc_hash_stats,
981 #ifdef CONFIG_SECURITY_SELINUX_AVC_STATS
982 static struct avc_cache_stats *sel_avc_get_stat_idx(loff_t *idx)
986 for (cpu = *idx; cpu < NR_CPUS; ++cpu) {
987 if (!cpu_possible(cpu))
990 return &per_cpu(avc_cache_stats, cpu);
995 static void *sel_avc_stats_seq_start(struct seq_file *seq, loff_t *pos)
1000 return SEQ_START_TOKEN;
1002 return sel_avc_get_stat_idx(&n);
1005 static void *sel_avc_stats_seq_next(struct seq_file *seq, void *v, loff_t *pos)
1007 return sel_avc_get_stat_idx(pos);
1010 static int sel_avc_stats_seq_show(struct seq_file *seq, void *v)
1012 struct avc_cache_stats *st = v;
1014 if (v == SEQ_START_TOKEN)
1015 seq_printf(seq, "lookups hits misses allocations reclaims "
1018 seq_printf(seq, "%u %u %u %u %u %u\n", st->lookups,
1019 st->hits, st->misses, st->allocations,
1020 st->reclaims, st->frees);
1024 static void sel_avc_stats_seq_stop(struct seq_file *seq, void *v)
1027 static struct seq_operations sel_avc_cache_stats_seq_ops = {
1028 .start = sel_avc_stats_seq_start,
1029 .next = sel_avc_stats_seq_next,
1030 .show = sel_avc_stats_seq_show,
1031 .stop = sel_avc_stats_seq_stop,
1034 static int sel_open_avc_cache_stats(struct inode *inode, struct file *file)
1036 return seq_open(file, &sel_avc_cache_stats_seq_ops);
1039 static struct file_operations sel_avc_cache_stats_ops = {
1040 .open = sel_open_avc_cache_stats,
1042 .llseek = seq_lseek,
1043 .release = seq_release,
1047 /* XXX upstream: d_alloc_name() */
1048 struct dentry *sel_alloc_name(struct dentry *parent, const char *name)
1053 q.len = strlen(name);
1054 q.hash = full_name_hash(q.name, q.len);
1055 return d_alloc(parent, &q);
1058 static int sel_make_avc_files(struct dentry *dir)
1061 static struct tree_descr files[] = {
1062 { "cache_threshold",
1063 &sel_avc_cache_threshold_ops, S_IRUGO|S_IWUSR },
1064 { "hash_stats", &sel_avc_hash_stats_ops, S_IRUGO },
1065 #ifdef CONFIG_SECURITY_SELINUX_AVC_STATS
1066 { "cache_stats", &sel_avc_cache_stats_ops, S_IRUGO },
1070 for (i = 0; i < sizeof (files) / sizeof (files[0]); i++) {
1071 struct inode *inode;
1072 struct dentry *dentry;
1074 dentry = sel_alloc_name(dir, files[i].name);
1080 inode = sel_make_inode(dir->d_sb, S_IFREG|files[i].mode);
1085 inode->i_fop = files[i].ops;
1086 d_add(dentry, inode);
1095 static int sel_make_dir(struct super_block *sb, struct dentry *dentry)
1098 struct inode *inode;
1100 inode = sel_make_inode(sb, S_IFDIR | S_IRUGO | S_IXUGO);
1105 inode->i_op = &simple_dir_inode_operations;
1106 inode->i_fop = &simple_dir_operations;
1107 d_add(dentry, inode);
1112 static int sel_fill_super(struct super_block * sb, void * data, int silent)
1115 struct dentry *dentry;
1116 struct inode *inode;
1117 struct inode_security_struct *isec;
1119 static struct tree_descr selinux_files[] = {
1120 [SEL_LOAD] = {"load", &sel_load_ops, S_IRUSR|S_IWUSR},
1121 [SEL_ENFORCE] = {"enforce", &sel_enforce_ops, S_IRUGO|S_IWUSR},
1122 [SEL_CONTEXT] = {"context", &sel_context_ops, S_IRUGO|S_IWUGO},
1123 [SEL_ACCESS] = {"access", &transaction_ops, S_IRUGO|S_IWUGO},
1124 [SEL_CREATE] = {"create", &transaction_ops, S_IRUGO|S_IWUGO},
1125 [SEL_RELABEL] = {"relabel", &transaction_ops, S_IRUGO|S_IWUGO},
1126 [SEL_USER] = {"user", &transaction_ops, S_IRUGO|S_IWUGO},
1127 [SEL_POLICYVERS] = {"policyvers", &sel_policyvers_ops, S_IRUGO},
1128 [SEL_COMMIT_BOOLS] = {"commit_pending_bools", &sel_commit_bools_ops, S_IWUSR},
1129 [SEL_MLS] = {"mls", &sel_mls_ops, S_IRUGO},
1130 [SEL_DISABLE] = {"disable", &sel_disable_ops, S_IWUSR},
1133 ret = simple_fill_super(sb, SELINUX_MAGIC, selinux_files);
1137 dentry = d_alloc_name(sb->s_root, BOOL_DIR_NAME);
1141 inode = sel_make_inode(sb, S_IFDIR | S_IRUGO | S_IXUGO);
1144 inode->i_op = &simple_dir_inode_operations;
1145 inode->i_fop = &simple_dir_operations;
1146 d_add(dentry, inode);
1148 ret = sel_make_bools();
1152 dentry = d_alloc_name(sb->s_root, NULL_FILE_NAME);
1156 inode = sel_make_inode(sb, S_IFCHR | S_IRUGO | S_IWUGO);
1159 isec = (struct inode_security_struct*)inode->i_security;
1160 isec->sid = SECINITSID_DEVNULL;
1161 isec->sclass = SECCLASS_CHR_FILE;
1162 isec->initialized = 1;
1164 init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3));
1165 d_add(dentry, inode);
1166 selinux_null = dentry;
1168 dentry = sel_alloc_name(sb->s_root, "avc");
1172 ret = sel_make_dir(sb, dentry);
1176 ret = sel_make_avc_files(dentry);
1183 printk(KERN_ERR "%s: failed while creating inodes\n", __FUNCTION__);
1187 static struct super_block *sel_get_sb(struct file_system_type *fs_type,
1188 int flags, const char *dev_name, void *data)
1190 return get_sb_single(fs_type, flags, data, sel_fill_super);
1193 static struct file_system_type sel_fs_type = {
1194 .name = "selinuxfs",
1195 .get_sb = sel_get_sb,
1196 .kill_sb = kill_litter_super,
1199 struct vfsmount *selinuxfs_mount;
1201 static int __init init_sel_fs(void)
1205 if (!selinux_enabled)
1207 err = register_filesystem(&sel_fs_type);
1209 selinuxfs_mount = kern_mount(&sel_fs_type);
1210 if (IS_ERR(selinuxfs_mount)) {
1211 printk(KERN_ERR "selinuxfs: could not mount!\n");
1212 err = PTR_ERR(selinuxfs_mount);
1213 selinuxfs_mount = NULL;
1219 __initcall(init_sel_fs);
1221 #ifdef CONFIG_SECURITY_SELINUX_DISABLE
1222 void exit_sel_fs(void)
1224 unregister_filesystem(&sel_fs_type);