blob: 08ccbf59c74f8d317c887f9c0ec909097050b896 [file] [log] [blame]
Stephen Smalley2dd4e512012-01-04 12:33:27 -05001# Life begins with the kernel.
2type kernel, domain;
Nick Kralevichfed8a2a2014-01-24 20:43:07 -08003
Stephen Smalley356f4be2014-05-23 11:26:19 -04004# setcon to init domain.
5allow kernel self:process setcurrent;
Nick Kralevichfed8a2a2014-01-24 20:43:07 -08006allow kernel init:process dyntransition;
7
Stephen Smalley2dd4e512012-01-04 12:33:27 -05008# The kernel is unconfined.
9unconfined_domain(kernel)
Nick Kralevich0c9708b2013-07-10 14:46:05 -070010
Stephen Smalley73b03462014-05-30 09:53:00 -040011# cgroup filesystem initialization prior to setting the cgroup root directory label.
12allow kernel unlabeled:dir search;
13
Stephen Smalley718bf842014-06-18 10:31:27 -040014# Mount usbfs.
15allow kernel usbfs:filesystem mount;
16
Stephen Smalleyeb1bbf22014-05-29 14:35:55 -040017# init direct restorecon calls prior to switching to init domain
18# /dev and /dev/socket
19allow kernel { device socket_device }:dir relabelto;
20# /dev/__properties__
21allow kernel properties_device:file relabelto;
22# /sys
23allow kernel sysfs:{ dir file lnk_file } relabelfrom;
24allow kernel sysfs_type:{ dir file lnk_file } relabelto;
Stephen Smalleyfea6e662013-12-06 08:05:53 -050025
26# Initial setenforce by init prior to switching to init domain.
Nick Kralevichabae8a92014-05-12 14:32:59 -070027# We use dontaudit instead of allow to prevent a kernel spawned userspace
28# process from turning off SELinux once enabled.
29dontaudit kernel self:security setenforce;
Stephen Smalley8b516742014-01-08 09:29:30 -050030
31# Set checkreqprot by init.rc prior to switching to init domain.
32allow kernel self:security setcheckreqprot;
Stephen Smalleybac4ccc2014-06-18 10:09:35 -040033
34###
35### neverallow rules
36###
37
38# The initial task starts in the kernel domain (assigned via
39# initial_sid_contexts), but nothing ever transitions to it.
40neverallow domain kernel:process { transition dyntransition };