2005-05-23 15:50:12 +00:00
|
|
|
## <summary>Policy for kernel module utilities</summary>
|
2005-04-20 19:07:16 +00:00
|
|
|
|
2009-12-01 14:23:11 +00:00
|
|
|
######################################
|
|
|
|
## <summary>
|
|
|
|
## Getattr the dependencies of kernel modules.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`modutils_getattr_module_deps',`
|
|
|
|
gen_require(`
|
|
|
|
type modules_dep_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
getattr_files_pattern($1, modules_object_t, modules_dep_t)
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Read the dependencies of kernel modules.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-05-10 18:09:08 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`modutils_read_module_deps',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type modules_dep_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
files_list_kernel_modules($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 modules_dep_t:file read_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2017-04-21 00:00:34 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read the kernel modules.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`modutils_read_module_objects',`
|
|
|
|
gen_require(`
|
|
|
|
type modules_object_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_list_kernel_modules($1)
|
|
|
|
allow $1 modules_object_t:file read_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Read the configuration options used when
|
|
|
|
## loading modules.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-05-10 18:09:08 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`modutils_read_module_config',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type modules_conf_t;
|
|
|
|
')
|
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)
|
2006-03-02 23:41:11 +00:00
|
|
|
files_search_boot($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2012-10-15 10:26:48 +00:00
|
|
|
allow $1 modules_conf_t:dir list_dir_perms;
|
|
|
|
allow $1 modules_conf_t:file read_file_perms;
|
|
|
|
allow $1 modules_conf_t:lnk_file read_lnk_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-10-14 18:42:42 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Rename a file with the configuration options used when
|
|
|
|
## loading modules.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-05-10 18:09:08 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-14 18:42:42 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`modutils_rename_module_config',`
|
2005-10-14 18:42:42 +00:00
|
|
|
gen_require(`
|
|
|
|
type modules_conf_t;
|
|
|
|
')
|
|
|
|
|
2009-12-01 14:23:11 +00:00
|
|
|
rename_files_pattern($1, modules_conf_t, modules_conf_t)
|
2005-10-14 18:42:42 +00:00
|
|
|
')
|
|
|
|
|
2008-09-12 14:18:20 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Unlink a file with the configuration options used when
|
|
|
|
## loading modules.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`modutils_delete_module_config',`
|
|
|
|
gen_require(`
|
|
|
|
type modules_conf_t;
|
|
|
|
')
|
|
|
|
|
2009-12-01 14:23:11 +00:00
|
|
|
delete_files_pattern($1, modules_conf_t, modules_conf_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Manage files with the configuration options used when
|
|
|
|
## loading modules.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`modutils_manage_module_config',`
|
|
|
|
gen_require(`
|
|
|
|
type modules_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
manage_files_pattern($1, modules_conf_t, modules_conf_t)
|
2008-09-12 14:18:20 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2017-02-18 21:09:24 +00:00
|
|
|
## Execute any modutil,
|
|
|
|
## like insmod, kmod, depmod or updates-modules,
|
|
|
|
## in the kmod domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:10:15 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2017-02-18 21:09:24 +00:00
|
|
|
interface(`modutils_domtrans',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
2017-02-18 21:09:24 +00:00
|
|
|
type kmod_t, kmod_exec_t;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
|
|
|
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_search_bin($1)
|
2017-02-18 21:09:24 +00:00
|
|
|
domtrans_pattern($1, kmod_exec_t, kmod_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-11-07 20:09:28 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2017-02-18 21:09:24 +00:00
|
|
|
## Execute any modutil,
|
|
|
|
## like insmod, kmod, depmod or updates-modules,
|
|
|
|
## in the kmod domain, and allow the specified role
|
|
|
|
## the kmod domain, and use the caller's terminal.
|
|
|
|
## Has a sigchld backchannel.
|
2005-11-07 20:09:28 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:10:15 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-07 20:09:28 +00:00
|
|
|
## </param>
|
2017-02-18 21:09:24 +00:00
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## Role allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
2005-11-07 20:09:28 +00:00
|
|
|
#
|
2017-02-18 21:09:24 +00:00
|
|
|
interface(`modutils_run',`
|
2005-11-07 20:09:28 +00:00
|
|
|
gen_require(`
|
2017-02-18 21:09:24 +00:00
|
|
|
attribute_role kmod_roles;
|
|
|
|
')
|
|
|
|
|
2017-02-18 21:35:45 +00:00
|
|
|
modutils_domtrans($1)
|
2017-02-18 21:09:24 +00:00
|
|
|
roleattribute $2 kmod_roles;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute any modutil,
|
|
|
|
## like insmod, kmod, depmod or updates-modules,
|
|
|
|
## in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`modutils_exec',`
|
|
|
|
gen_require(`
|
|
|
|
type kmod_exec_t;
|
2005-11-07 20:09:28 +00:00
|
|
|
')
|
|
|
|
|
2011-09-13 18:45:14 +00:00
|
|
|
corecmd_search_bin($1)
|
2017-02-18 21:09:24 +00:00
|
|
|
can_exec($1, kmod_exec_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Unconditionally execute insmod in the insmod domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
# cjp: this is added for pppd, due to nested
|
|
|
|
# conditionals not working.
|
|
|
|
interface(`modutils_domtrans_insmod_uncond',`
|
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_domtrans() instead.')
|
|
|
|
modutils_domtrans($1)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute insmod in the insmod domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`modutils_domtrans_insmod',`
|
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_domtrans() instead.')
|
|
|
|
modutils_domtrans($1)
|
2005-11-07 20:09:28 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute insmod in the insmod domain, and
|
|
|
|
## allow the specified role the insmod domain,
|
|
|
|
## and use the caller's terminal. Has a sigchld
|
|
|
|
## backchannel.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:10:15 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-03 13:20:22 +00:00
|
|
|
## Role allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_run_insmod',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_run() instead.')
|
|
|
|
modutils_run($1, $2)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Execute insmod in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_exec_insmod',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_exec() instead.')
|
|
|
|
modutils_exec($1)
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-04-21 21:34:47 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute depmod in the depmod domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:10:15 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_domtrans_depmod',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_domtrans() instead.')
|
|
|
|
modutils_domtrans($1)
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute depmod in the depmod domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:10:15 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-03 13:20:22 +00:00
|
|
|
## Role allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_run_depmod',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_run() instead.')
|
|
|
|
modutils_run($1, $2)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-21 21:34:47 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Execute depmod in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_exec_depmod',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_exec() instead.')
|
|
|
|
modutils_exec($1)
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2016-01-18 23:01:10 +00:00
|
|
|
## Execute update_modules in the update_modules domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:10:15 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_domtrans_update_mods',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_domtrans() instead.')
|
|
|
|
modutils_domtrans($1)
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute update_modules in the update_modules domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:10:15 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-03 13:20:22 +00:00
|
|
|
## Role allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_run_update_mods',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_run() instead.')
|
|
|
|
modutils_run($1, $2)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-21 21:34:47 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Execute update_modules in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-21 21:34:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`modutils_exec_update_mods',`
|
2017-02-18 21:09:24 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated, please use modutils_exec() instead.')
|
|
|
|
modutils_exec($1)
|
2005-04-21 21:34:47 +00:00
|
|
|
')
|
2017-02-08 00:03:59 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read kmod lib files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`modutils_read_var_run_files',`
|
2017-02-18 21:16:30 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated.')
|
2017-02-08 00:03:59 +00:00
|
|
|
')
|