2005-05-23 15:50:12 +00:00
|
|
|
## <summary>Policy for kernel module utilities</summary>
|
2005-04-20 19:07:16 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Read the dependencies of kernel modules.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`modutils_read_mods_deps',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type modules_dep_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
bootloader_list_kernel_modules($1)
|
2005-06-09 14:26:05 +00:00
|
|
|
allow $1 modules_dep_t:file r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Read the configuration options used when
|
|
|
|
## loading modules.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_read_module_conf',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type modules_conf_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
# This file type can be in /etc or
|
|
|
|
# /lib(64)?/modules
|
|
|
|
files_search_etc($1)
|
2005-06-29 14:26:41 +00:00
|
|
|
bootloader_search_boot($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
allow $1 modules_conf_t:file r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Execute insmod in the insmod domain.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_domtrans_insmod',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type insmod_t, insmod_exec_t;
|
|
|
|
class process sigchld;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
corecmd_search_sbin($1)
|
2005-06-09 14:26:05 +00:00
|
|
|
domain_auto_trans($1, insmod_exec_t, insmod_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 insmod_t:fd use;
|
|
|
|
allow insmod_t $1:fd use;
|
|
|
|
allow insmod_t $1:fifo_file rw_file_perms;
|
|
|
|
allow insmod_t $1:process sigchld;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Execute insmod in the insmod domain, and
|
|
|
|
## allow the specified role the insmod domain,
|
|
|
|
## and use the caller's terminal. Has a sigchld
|
|
|
|
## backchannel.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## The role to be allowed the insmod domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
|
|
|
## The type of the terminal allow the insmod domain to use.
|
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_run_insmod',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type insmod_t;
|
|
|
|
class chr_file rw_term_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
modutils_domtrans_insmod($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
role $2 types insmod_t;
|
2005-06-17 17:59:26 +00:00
|
|
|
allow insmod_t $3:chr_file rw_term_perms;
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# modutils_exec_insmod(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_exec_insmod',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type insmod_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
corecmd_search_sbin($1)
|
2005-06-09 14:26:05 +00:00
|
|
|
can_exec($1, insmod_exec_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-04-21 21:34:47 +00:00
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Execute depmod in the depmod domain.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_domtrans_depmod',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type depmod_t, depmod_exec_t;
|
|
|
|
class process sigchld;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
corecmd_search_sbin($1)
|
2005-06-09 14:26:05 +00:00
|
|
|
domain_auto_trans($1, depmod_exec_t, depmod_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 depmod_t:fd use;
|
|
|
|
allow depmod_t $1:fd use;
|
|
|
|
allow depmod_t $1:fifo_file rw_file_perms;
|
|
|
|
allow depmod_t $1:process sigchld;
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Execute depmod in the depmod domain.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## The role to be allowed the depmod domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
|
|
|
## The type of the terminal allow the depmod domain to use.
|
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_run_depmod',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type depmod_t;
|
|
|
|
class chr_file rw_term_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
modutils_domtrans_depmod($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
role $2 types insmod_t;
|
2005-06-17 17:59:26 +00:00
|
|
|
allow insmod_t $3:chr_file rw_term_perms;
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-21 21:34:47 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# modutils_exec_depmod(domain)
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_exec_depmod',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type depmod_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
corecmd_search_sbin($1)
|
2005-06-09 14:26:05 +00:00
|
|
|
can_exec($1, depmod_exec_t)
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Execute depmod in the depmod domain.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_domtrans_update_mods',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type update_modules_t, update_modules_exec_t;
|
|
|
|
class process signal;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
corecmd_search_sbin($1)
|
2005-06-09 14:26:05 +00:00
|
|
|
domain_auto_trans($1, update_modules_exec_t, update_modules_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 update_modules_t:fd use;
|
|
|
|
allow update_modules_t $1:fd use;
|
|
|
|
allow update_modules_t $1:fifo_file rw_file_perms;
|
|
|
|
allow update_modules_t $1:process sigchld;
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <desc>
|
|
|
|
## Execute update_modules in the update_modules domain.
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## The role to be allowed the update_modules domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
|
|
|
## The type of the terminal allow the update_modules domain to use.
|
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_run_update_mods',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type update_modules_t;
|
|
|
|
class chr_file rw_term_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
modutils_domtrans_update_mods($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
role $2 types update_modules_t;
|
2005-06-17 17:59:26 +00:00
|
|
|
allow update_modules_t $3:chr_file rw_term_perms;
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-21 21:34:47 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# modutils_exec_update_mods(domain)
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_exec_update_mods',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type update_modules_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
corecmd_search_sbin($1)
|
2005-06-09 14:26:05 +00:00
|
|
|
can_exec($1, update_modules_exec_t)
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
|
|
|
|