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
##	<infoflow type="read" weight="10"/>
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 0c73cd
	allow $1 modules_dep_t:file { getattr read };
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 daa0e0
## <interface name="modutils_read_kernel_module_loading_config">
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
##	<infoflow type="read" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_read_kernel_module_loading_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 modules_conf_t:file { getattr read };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`modutils_read_kernel_module_loading_config_depend',`
Chris PeBenito 0c73cd
	type modules_conf_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr create read write setattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito daa0e0
## <interface name="modutils_insmod_transition">
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
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_insmod_transition',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 insmod_exec_t:file { getattr read execute };
Chris PeBenito 0c73cd
	allow $1 insmod_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 insmod_exec_t:process insmod_t;
Chris PeBenito 0c73cd
	dontaudit $1 insmod_t:process { noatsecure siginh rlimitinh };
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
define(`modutils_insmod_transition_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 daa0e0
## <interface name="modutils_insmod_transition_add_role_use_terminal">
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
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito daa0e0
define(`modutils_insmod_transition_add_role_use_terminal',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	modutils_insmod_transition($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 daa0e0
define(`modutils_insmod_transition_add_role_use_terminal_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 bd202f
# modutils_insmod_execute(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_insmod_execute',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 insmod_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`modutils_insmod_execute_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 daa0e0
## <interface name="modutils_depmod_transition">
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
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_depmod_transition',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 depmod_exec_t:file { getattr read execute };
Chris PeBenito 0c73cd
	allow $1 depmod_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 depmod_exec_t:process depmod_t;
Chris PeBenito 0c73cd
	dontaudit $1 depmod_t:process { noatsecure siginh rlimitinh };
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
define(`modutils_depmod_transition_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 daa0e0
## <interface name="modutils_depmod_transition_add_role_use_terminal">
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
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito daa0e0
define(`modutils_depmod_transition_add_role_use_terminal',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	modutils_depmod_transition($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 daa0e0
define(`modutils_depmod_transition_add_role_use_terminal_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 bd202f
# modutils_depmod_execute(domain)
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_depmod_execute',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 depmod_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
define(`modutils_depmod_execute_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 daa0e0
## <interface name="modutils_update_modules_transition">
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
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_update_modules_transition',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 update_modules_exec_t:file { getattr read execute };
Chris PeBenito 0c73cd
	allow $1 update_modules_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 update_modules_exec_t:process update_modules_t;
Chris PeBenito 0c73cd
	dontaudit $1 update_modules_t:process { noatsecure siginh rlimitinh };
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
define(`modutils_update_modules_transition_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 daa0e0
## <interface name="modutils_update_modules_transition_add_role_use_terminal">
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
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito daa0e0
define(`modutils_update_modules_transition_add_role_use_terminal',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	modutils_update_modules_transition($1)
Chris PeBenito 0c73cd
	role $2 types update_modules_t;
Chris PeBenito 0c73cd
	allow update_modules_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
define(`modutils_update_modules_transition_add_role_use_terminal_depend',`
Chris PeBenito 0c73cd
	type update_modules_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 bd202f
# modutils_update_modules_execute(domain)
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_update_modules_execute',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 update_modules_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
define(`modutils_update_modules_execute_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>