|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
960373 |
policy_module(devices,1.0)
|
|
Chris PeBenito |
960373 |
|
|
Chris PeBenito |
fd89e1 |
########################################
|
|
Chris PeBenito |
fd89e1 |
#
|
|
Chris PeBenito |
fd89e1 |
# Declarations
|
|
Chris PeBenito |
fd89e1 |
#
|
|
Chris PeBenito |
fd89e1 |
|
|
Chris PeBenito |
b4cd15 |
attribute device_node;
|
|
Chris PeBenito |
6b6740 |
attribute memory_raw_read;
|
|
Chris PeBenito |
6b6740 |
attribute memory_raw_write;
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# device_t is the type of /dev.
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
ee5772 |
type device_t;
|
|
Chris PeBenito |
8fd367 |
files_type(device_t)
|
|
Chris PeBenito |
c9428d |
files_mountpoint(device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(device_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
# Only directories and symlinks should be labeled device_t.
|
|
Chris PeBenito |
b4cd15 |
# If there are other files with this type, it is wrong.
|
|
Chris PeBenito |
b4cd15 |
# Relabelto is allowed for setfiles to function, in case
|
|
Chris PeBenito |
b4cd15 |
# a device node has no specific type yet, but is for some
|
|
Chris PeBenito |
b4cd15 |
# reason labeled with a specific type
|
|
Chris PeBenito |
07d6e3 |
#cjp: want this, but udev policy breaks this
|
|
Chris PeBenito |
fd89e1 |
#neverallow domain device_t:{ file fifo_file sock_file chr_file blk_file } ~{ getattr setattr relabelfrom relabelto };
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# Type for /dev/agpgart
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type agp_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(agp_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(agp_device_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# Type for /dev/apm_bios
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type apm_bios_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(apm_bios_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(apm_bios_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
dec168 |
type cardmgr_dev_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(cardmgr_dev_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(cardmgr_dev_t)
|
|
Chris PeBenito |
34e722 |
files_tmp_file(cardmgr_dev_t)
|
|
Chris PeBenito |
dec168 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# clock_device_t is the type of
|
|
Chris PeBenito |
b4cd15 |
# /dev/rtc.
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type clock_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(clock_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(clock_device_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# cpu control devices /dev/cpu/0/*
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type cpu_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(cpu_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(cpu_device_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
0907bd |
# for the IBM zSeries z90crypt hardware ssl accelorator
|
|
Chris PeBenito |
0907bd |
type crypt_device_t, device_node;
|
|
Chris PeBenito |
0907bd |
fs_associate(crypt_device_t)
|
|
Chris PeBenito |
0907bd |
fs_associate_tmpfs(crypt_device_t)
|
|
Chris PeBenito |
0907bd |
|
|
Chris PeBenito |
6b6740 |
type dri_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(dri_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(dri_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
6b6740 |
type event_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(event_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(event_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
# Type for framebuffer /dev/fb/*
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type framebuf_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(framebuf_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(framebuf_device_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
700988 |
# Type for /dev/mapper/control
|
|
Chris PeBenito |
700988 |
#
|
|
Chris PeBenito |
700988 |
type lvm_control_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(lvm_control_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(lvm_control_t)
|
|
Chris PeBenito |
700988 |
|
|
Chris PeBenito |
700988 |
#
|
|
Chris PeBenito |
6b6740 |
# memory_device_t is the type of /dev/kmem,
|
|
Chris PeBenito |
6b6740 |
# /dev/mem and /dev/port.
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
type memory_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(memory_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(memory_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
6b6740 |
neverallow ~memory_raw_read memory_device_t:{ chr_file blk_file } read;
|
|
Chris PeBenito |
6b6740 |
neverallow ~memory_raw_write memory_device_t:{ chr_file blk_file } { append write };
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
b16c6b |
type misc_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(misc_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(misc_device_t)
|
|
Chris PeBenito |
b16c6b |
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
# A more general type for mouse devices.
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
type mouse_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(mouse_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(mouse_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
b4cd15 |
# Type for /dev/cpu/mtrr and /proc/mtrr
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type mtrr_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(mtrr_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(mtrr_device_t)
|
|
Chris PeBenito |
e02c61 |
genfscon proc /mtrr gen_context(system_u:object_r:mtrr_device_t,s0)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
6b6740 |
# null_device_t is the type of /dev/null.
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
type null_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(null_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(null_device_t)
|
|
Chris PeBenito |
f0574f |
mls_trusted_object(null_device_t)
|
|
Chris PeBenito |
e02c61 |
sid devnull gen_context(system_u:object_r:null_device_t,s0)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
b4cd15 |
# Type for /dev/pmu
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type power_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(power_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(power_device_t)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
46be1f |
type printer_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(printer_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(printer_device_t)
|
|
Chris PeBenito |
46be1f |
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
6b6740 |
# random_device_t is the type of /dev/random
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
type random_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(random_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(random_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
6b6740 |
type scanner_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(scanner_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(scanner_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
b4cd15 |
# Type for sound devices and mixers
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
type sound_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(sound_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(sound_device_t)
|
|
Chris PeBenito |
700988 |
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
8bd678 |
# sysfs_t is the type for the /sys pseudofs
|
|
Chris PeBenito |
8bd678 |
#
|
|
Chris PeBenito |
8bd678 |
type sysfs_t;
|
|
Chris PeBenito |
8bd678 |
files_mountpoint(sysfs_t)
|
|
Chris PeBenito |
cbca03 |
fs_type(sysfs_t)
|
|
Chris PeBenito |
e02c61 |
genfscon sysfs / gen_context(system_u:object_r:sysfs_t,s0)
|
|
Chris PeBenito |
8bd678 |
|
|
Chris PeBenito |
8bd678 |
#
|
|
Chris PeBenito |
6b6740 |
# urandom_device_t is the type of /dev/urandom
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
type urandom_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(urandom_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(urandom_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
8bd678 |
#
|
|
Chris PeBenito |
8bd678 |
# usbfs_t is the type for the /proc/bus/usb pseudofs
|
|
Chris PeBenito |
8bd678 |
#
|
|
Chris PeBenito |
8bd678 |
type usbfs_t alias usbdevfs_t;
|
|
Chris PeBenito |
8bd678 |
files_mountpoint(usbfs_t)
|
|
Chris PeBenito |
8bd678 |
fs_make_noxattr_fs(usbfs_t)
|
|
Chris PeBenito |
e02c61 |
genfscon usbfs / gen_context(system_u:object_r:usbfs_t,s0)
|
|
Chris PeBenito |
e02c61 |
genfscon usbdevfs / gen_context(system_u:object_r:usbfs_t,s0)
|
|
Chris PeBenito |
8bd678 |
|
|
Chris PeBenito |
35b2fb |
type v4l_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(v4l_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(v4l_device_t)
|
|
Chris PeBenito |
35b2fb |
|
|
Chris PeBenito |
700988 |
type xserver_misc_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(xserver_misc_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(xserver_misc_device_t)
|
|
Chris PeBenito |
6b6740 |
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
# zero_device_t is the type of /dev/zero.
|
|
Chris PeBenito |
6b6740 |
#
|
|
Chris PeBenito |
6b6740 |
type zero_device_t, device_node;
|
|
Chris PeBenito |
763c44 |
fs_associate(zero_device_t)
|
|
Chris PeBenito |
0fd9dc |
fs_associate_tmpfs(zero_device_t)
|
|
Chris PeBenito |
f0574f |
mls_trusted_object(zero_device_t)
|
|
Chris PeBenito |
710791 |
|
|
Chris PeBenito |
710791 |
|
|
Chris PeBenito |
710791 |
# TODO:
|
|
Chris PeBenito |
710791 |
|
|
Chris PeBenito |
710791 |
# this is not actually a device
|
|
Chris PeBenito |
710791 |
# move it to xserver
|
|
Chris PeBenito |
710791 |
type xconsole_device_t;
|
|
Chris PeBenito |
710791 |
files_type(xconsole_device_t)
|
|
Chris PeBenito |
710791 |
|
|
Chris PeBenito |
710791 |
# devfs is dead on selinux
|
|
Chris PeBenito |
710791 |
# this should be removed
|
|
Chris PeBenito |
710791 |
type devfs_control_t, device_node;
|
|
Chris PeBenito |
710791 |
fs_associate(devfs_control_t)
|
|
Chris PeBenito |
710791 |
fs_associate_tmpfs(devfs_control_t)
|