Chris PeBenito 162a57
## <summary>Policy for kernel module utilities</summary>
Chris PeBenito e181fe
Chris PeBenito b4cd15
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Read the dependencies of kernel modules.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 1815ba
interface(`modutils_read_module_deps',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type modules_dep_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 1c1ac6
	files_list_kernel_modules($1)
Chris PeBenito 80048c
	allow $1 modules_dep_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Read the configuration options used when
Chris PeBenito 414e41
##	loading modules.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 1815ba
interface(`modutils_read_module_config',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type modules_conf_t;
Chris PeBenito 139520
	')
Chris PeBenito b4cd15
Chris PeBenito 139520
	# This file type can be in /etc or
Chris PeBenito 139520
	# /lib(64)?/modules
Chris PeBenito 139520
	files_search_etc($1)
Chris PeBenito 1c1ac6
	files_search_boot($1)
Chris PeBenito 0c73cd
Chris PeBenito 725926
	allow $1 modules_conf_t:{ file lnk_file } r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito fe9d17
##	Rename a file with the configuration options used when
Chris PeBenito fe9d17
##	loading modules.
Chris PeBenito fe9d17
## </summary>
Chris PeBenito fe9d17
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito fe9d17
## </param>
Chris PeBenito fe9d17
#
Chris PeBenito 1815ba
interface(`modutils_rename_module_config',`
Chris PeBenito fe9d17
	gen_require(`
Chris PeBenito fe9d17
		type modules_conf_t;
Chris PeBenito fe9d17
	')
Chris PeBenito fe9d17
Chris PeBenito fe9d17
	allow $1 modules_conf_t:file rename;
Chris PeBenito fe9d17
')
Chris PeBenito fe9d17
Chris PeBenito fe9d17
########################################
Chris PeBenito fe9d17
## <summary>
Chris PeBenito 8967bf
##	Unconditionally execute insmod in the insmod domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 8967bf
# cjp: this is added for pppd, due to nested
Chris PeBenito 8967bf
# conditionals not working.
Chris PeBenito 8967bf
interface(`modutils_domtrans_insmod_uncond',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type insmod_t, insmod_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 139520
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito 80048c
	domain_auto_trans($1, insmod_exec_t, insmod_t)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 insmod_t:fd use;
Chris PeBenito 0c73cd
	allow insmod_t $1:fd use;
Chris PeBenito 0c73cd
	allow insmod_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow insmod_t $1:process sigchld;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 8967bf
##	Execute insmod in the insmod domain.
Chris PeBenito 8967bf
## </summary>
Chris PeBenito 8967bf
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 8967bf
## </param>
Chris PeBenito 8967bf
#
Chris PeBenito 8967bf
interface(`modutils_domtrans_insmod',`
Chris PeBenito 8967bf
	gen_require(`
Chris PeBenito 8967bf
		bool secure_mode_insmod;
Chris PeBenito 8967bf
	')
Chris PeBenito 8967bf
Chris PeBenito 8967bf
	if (!secure_mode_insmod) {
Chris PeBenito 8967bf
		modutils_domtrans_insmod_uncond($1)
Chris PeBenito 8967bf
	}
Chris PeBenito 8967bf
')
Chris PeBenito 8967bf
Chris PeBenito 8967bf
########################################
Chris PeBenito 8967bf
## <summary>
Chris PeBenito 414e41
##	Execute insmod in the insmod domain, and
Chris PeBenito 414e41
##	allow the specified role the insmod domain,
Chris PeBenito 414e41
##	and use the caller's terminal.  Has a sigchld
Chris PeBenito 414e41
##	backchannel.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 414e41
##	The role to be allowed the insmod domain.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 414e41
##	The type of the terminal allow the insmod domain to use.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito daa0e0
#
Chris PeBenito 199895
interface(`modutils_run_insmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type insmod_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	modutils_domtrans_insmod($1)
Chris PeBenito 0c73cd
	role $2 types insmod_t;
Chris PeBenito 139520
	allow insmod_t $3:chr_file rw_term_perms;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito ac9db9
## <summary>
Chris PeBenito ac9db9
##	Execute insmod in the caller domain.
Chris PeBenito ac9db9
## </summary>
Chris PeBenito ac9db9
## <param name="domain">
Chris PeBenito ac9db9
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito ac9db9
##	</summary>
Chris PeBenito ac9db9
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`modutils_exec_insmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 71fe0f
		type insmod_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito 80048c
	can_exec($1, insmod_exec_t)
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 9eb5e8
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute depmod in the depmod domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 9eb5e8
#
Chris PeBenito 199895
interface(`modutils_domtrans_depmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type depmod_t, depmod_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 139520
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito 80048c
	domain_auto_trans($1, depmod_exec_t, depmod_t)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 depmod_t:fd use;
Chris PeBenito 0c73cd
	allow depmod_t $1:fd use;
Chris PeBenito 0c73cd
	allow depmod_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow depmod_t $1:process sigchld;
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute depmod in the depmod domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 414e41
##	The role to be allowed the depmod domain.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 414e41
##	The type of the terminal allow the depmod domain to use.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito daa0e0
#
Chris PeBenito 199895
interface(`modutils_run_depmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type depmod_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	modutils_domtrans_depmod($1)
Chris PeBenito 46c69c
	role $2 types depmod_t;
Chris PeBenito 139520
	allow insmod_t $3:chr_file rw_term_perms;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito ac9db9
## <summary>
Chris PeBenito ac9db9
##	Execute depmod in the caller domain.
Chris PeBenito ac9db9
## </summary>
Chris PeBenito ac9db9
## <param name="domain">
Chris PeBenito ac9db9
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito ac9db9
##	</summary>
Chris PeBenito ac9db9
## </param>
Chris PeBenito 9eb5e8
#
Chris PeBenito 199895
interface(`modutils_exec_depmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 12ae75
		type depmod_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito 80048c
	can_exec($1, depmod_exec_t)
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute depmod in the depmod domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 9eb5e8
#
Chris PeBenito 199895
interface(`modutils_domtrans_update_mods',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type update_modules_t, update_modules_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 139520
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito 80048c
	domain_auto_trans($1, update_modules_exec_t, update_modules_t)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 update_modules_t:fd use;
Chris PeBenito 0c73cd
	allow update_modules_t $1:fd use;
Chris PeBenito 0c73cd
	allow update_modules_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow update_modules_t $1:process sigchld;
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute update_modules in the update_modules domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 414e41
##	The role to be allowed the update_modules domain.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 414e41
##	The type of the terminal allow the update_modules domain to use.
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 414e41
## </param>
Chris PeBenito daa0e0
#
Chris PeBenito 199895
interface(`modutils_run_update_mods',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type update_modules_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	modutils_domtrans_update_mods($1)
Chris PeBenito 0c73cd
	role $2 types update_modules_t;
Chris PeBenito 139520
	allow update_modules_t $3:chr_file rw_term_perms;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito ac9db9
## <summary>
Chris PeBenito ac9db9
##	Execute update_modules in the caller domain.
Chris PeBenito ac9db9
## </summary>
Chris PeBenito ac9db9
## <param name="domain">
Chris PeBenito ac9db9
##	<summary>
Chris PeBenito ac9db9
##	Domain allowed access.
Chris PeBenito ac9db9
##	</summary>
Chris PeBenito ac9db9
## </param>
Chris PeBenito 9eb5e8
#
Chris PeBenito 199895
interface(`modutils_exec_update_mods',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 12ae75
		type update_modules_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito 80048c
	can_exec($1, update_modules_exec_t)
Chris PeBenito 9eb5e8
')