Modern systems shouldn't need direct access to raw memory devices (/dev/mem, /dev/kmem, /dev/mergemem, dev/oldmem, /dev/port) anymore, so let's remove the access in most cases and make it tunable in the rest. Add dev_read_raw_memory_cond(), dev_write_raw_memory_cond() and dev_wx_raw_memory_cond(), which are conditional to new boolean allow_raw_memory_access. Remove raw memory access for a few domains that should never have needed it (colord_t, iscsid_t, mdamd_t, txtstat_t), should not need it anymore (dmidecode_t, Debian devicekit_diskt_t, hald_t, hald_mac_t, xserver_t) or the domains that should transition to different domain for this (rpm_t, kudzu_t, dpkg_t). Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
40 lines
784 B
Plaintext
40 lines
784 B
Plaintext
policy_module(dmidecode, 1.9.0)
|
|
|
|
########################################
|
|
#
|
|
# Declarations
|
|
#
|
|
|
|
attribute_role dmidecode_roles;
|
|
roleattribute system_r dmidecode_roles;
|
|
|
|
type dmidecode_t;
|
|
type dmidecode_exec_t;
|
|
application_domain(dmidecode_t, dmidecode_exec_t)
|
|
role dmidecode_roles types dmidecode_t;
|
|
|
|
########################################
|
|
#
|
|
# Local policy
|
|
#
|
|
|
|
allow dmidecode_t self:capability sys_rawio;
|
|
|
|
dev_read_sysfs(dmidecode_t)
|
|
|
|
domain_use_interactive_fds(dmidecode_t)
|
|
|
|
files_list_usr(dmidecode_t)
|
|
|
|
mls_file_read_all_levels(dmidecode_t)
|
|
|
|
locallogin_use_fds(dmidecode_t)
|
|
|
|
userdom_use_inherited_user_terminals(dmidecode_t)
|
|
|
|
ifdef(`init_systemd',`
|
|
# inherits /dev/null and a socket from devicekit_disk_t
|
|
init_use_fds(dmidecode_t)
|
|
init_rw_inherited_stream_socket(dmidecode_t)
|
|
')
|