2021-02-03 13:38:26 +00:00
|
|
|
policy_module(vbetool, 1.10.0)
|
2018-06-23 13:00:56 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Determine whether attempts by
|
|
|
|
## vbetool to mmap low regions should
|
|
|
|
## be silently blocked.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
gen_tunable(vbetool_mmap_zero_ignore, false)
|
|
|
|
|
|
|
|
attribute_role vbetool_roles;
|
|
|
|
|
|
|
|
type vbetool_t;
|
|
|
|
type vbetool_exec_t;
|
|
|
|
init_system_domain(vbetool_t, vbetool_exec_t)
|
|
|
|
role vbetool_roles types vbetool_t;
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow vbetool_t self:capability { dac_override sys_admin sys_tty_config };
|
|
|
|
allow vbetool_t self:process execmem;
|
|
|
|
|
Make raw memory access tunable
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>
2020-02-22 15:49:24 +00:00
|
|
|
dev_wx_raw_memory_cond(vbetool_t, allow_raw_memory_access)
|
|
|
|
dev_read_raw_memory_cond(vbetool_t, allow_raw_memory_access)
|
2018-06-23 13:00:56 +00:00
|
|
|
dev_rwx_zero(vbetool_t)
|
|
|
|
dev_rw_sysfs(vbetool_t)
|
|
|
|
dev_rw_xserver_misc(vbetool_t)
|
|
|
|
dev_rw_mtrr(vbetool_t)
|
|
|
|
|
|
|
|
domain_mmap_low(vbetool_t)
|
|
|
|
|
|
|
|
mls_file_read_all_levels(vbetool_t)
|
|
|
|
mls_file_write_all_levels(vbetool_t)
|
|
|
|
|
|
|
|
term_use_unallocated_ttys(vbetool_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(vbetool_t)
|
|
|
|
|
|
|
|
tunable_policy(`vbetool_mmap_zero_ignore',`
|
|
|
|
dontaudit vbetool_t self:memprotect mmap_zero;
|
|
|
|
')
|