Chris PeBenito 162a57
## <summary>Policy for kernel module utilities</summary>
Chris PeBenito e181fe
Chris PeBenito b4cd15
########################################
Chris PeBenito 414e41
## <desc>
Chris PeBenito 414e41
##	Read the dependencies of kernel modules.
Chris PeBenito 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 8fd367
interface(`modutils_read_mods_deps',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type modules_dep_t;
Chris PeBenito 139520
		class file r_file_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	bootloader_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 414e41
## <desc>
Chris PeBenito 414e41
##	Read the configuration options used when
Chris PeBenito 414e41
##	loading modules.
Chris PeBenito 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`modutils_read_module_conf',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type modules_conf_t;
Chris PeBenito 139520
		class file r_file_perms;
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 8fd367
	bootloader_search_boot($1)
Chris PeBenito 0c73cd
Chris PeBenito 139520
	allow $1 modules_conf_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito 414e41
## <desc>
Chris PeBenito 414e41
##	Execute insmod in the insmod domain.
Chris PeBenito 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`modutils_domtrans_insmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type insmod_t, insmod_exec_t;
Chris PeBenito 139520
		class process sigchld;
Chris PeBenito 139520
		class fd use;
Chris PeBenito 139520
		class fifo_file rw_file_perms;
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 414e41
## <desc>
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 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 414e41
##	The role to be allowed the insmod domain.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 414e41
##	The type of the terminal allow the insmod domain to use.
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
		class chr_file rw_term_perms;
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 b4cd15
#
Chris PeBenito c9428d
# modutils_exec_insmod(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 199895
interface(`modutils_exec_insmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type insmod_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 414e41
## <desc>
Chris PeBenito 414e41
##	Execute depmod in the depmod domain.
Chris PeBenito 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
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
		class process sigchld;
Chris PeBenito 139520
		class fd use;
Chris PeBenito 139520
		class fifo_file rw_file_perms;
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 414e41
## <desc>
Chris PeBenito 414e41
##	Execute depmod in the depmod domain.
Chris PeBenito 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 414e41
##	The role to be allowed the depmod domain.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 414e41
##	The type of the terminal allow the depmod domain to use.
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
		class chr_file rw_term_perms;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	modutils_domtrans_depmod($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 9eb5e8
#
Chris PeBenito c9428d
# modutils_exec_depmod(domain)
Chris PeBenito 9eb5e8
#
Chris PeBenito 199895
interface(`modutils_exec_depmod',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type depmod_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 414e41
## <desc>
Chris PeBenito 414e41
##	Execute depmod in the depmod domain.
Chris PeBenito 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
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
		class process signal;
Chris PeBenito 139520
		class fd use;
Chris PeBenito 139520
		class fifo_file rw_file_perms;
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 414e41
## <desc>
Chris PeBenito 414e41
##	Execute update_modules in the update_modules domain.
Chris PeBenito 414e41
## </desc>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 414e41
##	The type of the process performing this action.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 414e41
##	The role to be allowed the update_modules domain.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 414e41
##	The type of the terminal allow the update_modules domain to use.
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
		class chr_file rw_term_perms;
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 9eb5e8
#
Chris PeBenito c9428d
# modutils_exec_update_mods(domain)
Chris PeBenito 9eb5e8
#
Chris PeBenito 199895
interface(`modutils_exec_update_mods',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type update_modules_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
')
Chris PeBenito 9eb5e8