Chris PeBenito 162a57
## <module name="modutils" layer="system">
Chris PeBenito 162a57
## <summary>Policy for kernel module utilities</summary>
Chris PeBenito e181fe
Chris PeBenito b4cd15
########################################
Chris PeBenito daa0e0
## <interface name="modutils_read_kernel_module_dependencies">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Read the dependencies of kernel modules.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_read_kernel_module_dependencies',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
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
define(`modutils_read_kernel_module_dependencies_depend',`
Chris PeBenito 0c73cd
	type modules_dep_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr create read write setattr unlink };
Chris PeBenito 0c73cd
	class dir { search read write add_name remove_name };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito c9428d
## <interface name="modutils_read_module_conf">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Read the configuration options used when
Chris PeBenito daa0e0
##		loading modules.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`modutils_read_module_conf',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 80048c
	allow $1 modules_conf_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`modutils_read_module_conf_depend',`
Chris PeBenito 0c73cd
	type modules_conf_t;
Chris PeBenito 0c73cd
Chris PeBenito 80048c
	class file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito c9428d
## <interface name="modutils_domtrans_insmod">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito f5c42b
##		Execute insmod in the insmod domain.  Has a
Chris PeBenito f5c42b
##		sigchld backchannel.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`modutils_domtrans_insmod',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
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 c9428d
define(`modutils_domtrans_insmod_depend',`
Chris PeBenito 0c73cd
	type insmod_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr read execute };
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito c9428d
## <interface name="modutils_run_insmod">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute insmod in the insmod domain, and
Chris PeBenito daa0e0
##		allow the specified role the insmod domain,
Chris PeBenito f5c42b
##		and use the caller's terminal.  Has a sigchld
Chris PeBenito f5c42b
##		backchannel.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the insmod domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the insmod domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`modutils_run_insmod',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	modutils_domtrans_insmod($1)
Chris PeBenito 0c73cd
	role $2 types insmod_t;
Chris PeBenito 0c73cd
	allow insmod_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`modutils_run_insmod_depend',`
Chris PeBenito 0c73cd
	type insmod_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
# modutils_exec_insmod(domain)
Chris PeBenito b4cd15
#
Chris PeBenito c9428d
define(`modutils_exec_insmod',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 80048c
	can_exec($1, insmod_exec_t)
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito c9428d
define(`modutils_exec_insmod_depend',`
Chris PeBenito 0c73cd
	type insmod_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr read execute execute_no_trans };
Chris PeBenito b4cd15
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito c9428d
## <interface name="modutils_domtrans_depmod">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute depmod in the depmod domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 9eb5e8
#
Chris PeBenito c9428d
define(`modutils_domtrans_depmod',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
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 c9428d
define(`modutils_domtrans_depmod_depend',`
Chris PeBenito 0c73cd
	type depmod_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr read execute };
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito c9428d
## <interface name="modutils_run_depmod">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute depmod in the depmod domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the depmod domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the depmod domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`modutils_run_depmod',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	modutils_domtrans_depmod($1)
Chris PeBenito 0c73cd
	role $2 types insmod_t;
Chris PeBenito 0c73cd
	allow insmod_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`modutils_run_depmod_depend',`
Chris PeBenito 0c73cd
	type depmod_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito 9eb5e8
#
Chris PeBenito c9428d
# modutils_exec_depmod(domain)
Chris PeBenito 9eb5e8
#
Chris PeBenito c9428d
define(`modutils_exec_depmod',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 80048c
	can_exec($1, depmod_exec_t)
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito c9428d
define(`modutils_exec_depmod_depend',`
Chris PeBenito 0c73cd
	type depmod_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito c9428d
## <interface name="modutils_domtrans_update_mods">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute depmod in the depmod domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 9eb5e8
#
Chris PeBenito c9428d
define(`modutils_domtrans_update_mods',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
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 c9428d
define(`modutils_domtrans_update_mods_depend',`
Chris PeBenito 0c73cd
	type update_modules_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr read execute };
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh signal };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito c9428d
## <interface name="modutils_run_update_mods">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute update_modules in the update_modules domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the update_modules domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the update_modules domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito c9428d
define(`modutils_run_update_mods',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	modutils_domtrans_update_mods($1)
Chris PeBenito 0c73cd
	role $2 types update_modules_t;
Chris PeBenito 80048c
	allow update_modules_t $3:chr_file rw_file_perms;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`modutils_run_update_mods_depend',`
Chris PeBenito 0c73cd
	type update_modules_t;
Chris PeBenito 0c73cd
Chris PeBenito 80048c
	class chr_file rw_file_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 c9428d
define(`modutils_exec_update_mods',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 80048c
	can_exec($1, update_modules_exec_t)
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito c9428d
define(`modutils_exec_update_mods_depend',`
Chris PeBenito 0c73cd
	type update_modules_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 162a57
Chris PeBenito 162a57
## </module>