Chris PeBenito 17de1b
## <summary>Policy for kernel module utilities</summary>
Chris PeBenito 17de1b
Chris PeBenito 7491a9
######################################
Chris PeBenito 7491a9
## <summary>
Chris PeBenito 7491a9
##	Getattr the dependencies of kernel modules.
Chris PeBenito 7491a9
## </summary>
Chris PeBenito 7491a9
## <param name="domain">
Chris PeBenito 7491a9
##	<summary>
Chris PeBenito 7491a9
##	Domain allowed access.
Chris PeBenito 7491a9
##	</summary>
Chris PeBenito 7491a9
## </param>
Chris PeBenito 7491a9
#
Chris PeBenito 7491a9
interface(`modutils_getattr_module_deps',`
Chris PeBenito 7491a9
	gen_require(`
Chris PeBenito 7491a9
		type modules_dep_t;
Chris PeBenito 7491a9
	')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
	getattr_files_pattern($1, modules_object_t, modules_dep_t)
Chris PeBenito 7491a9
')
Chris PeBenito 7491a9
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read the dependencies of kernel modules.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_read_module_deps',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type modules_dep_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_list_kernel_modules($1)
Chris PeBenito c0868a
	allow $1 modules_dep_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Dan Walsh 3eaa99
##	list the configuration options used when
Dan Walsh 3eaa99
##	loading modules.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <rolecap/>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`modutils_list_module_config',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type modules_conf_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	list_dirs_pattern($1, modules_conf_t, modules_conf_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Chris PeBenito 17de1b
##	Read the configuration options used when
Chris PeBenito 17de1b
##	loading modules.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_read_module_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type modules_conf_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# This file type can be in /etc or
Chris PeBenito 17de1b
	# /lib(64)?/modules
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 17de1b
	files_search_boot($1)
Chris PeBenito 17de1b
Chris PeBenito 7491a9
	read_files_pattern($1, modules_conf_t, modules_conf_t)
Chris PeBenito 7491a9
	read_lnk_files_pattern($1, modules_conf_t, modules_conf_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Rename a file with the configuration options used when
Chris PeBenito 17de1b
##	loading modules.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_rename_module_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type modules_conf_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 7491a9
	rename_files_pattern($1, modules_conf_t, modules_conf_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 36095d
##	Unlink a file with the configuration options used when
Chris PeBenito 36095d
##	loading modules.
Chris PeBenito 36095d
## </summary>
Chris PeBenito 36095d
## <param name="domain">
Chris PeBenito 36095d
##	<summary>
Chris PeBenito 36095d
##	Domain allowed access.
Chris PeBenito 36095d
##	</summary>
Chris PeBenito 36095d
## </param>
Chris PeBenito 36095d
#
Chris PeBenito 36095d
interface(`modutils_delete_module_config',`
Chris PeBenito 36095d
	gen_require(`
Chris PeBenito 36095d
		type modules_conf_t;
Chris PeBenito 36095d
	')
Chris PeBenito 36095d
Chris PeBenito 7491a9
	delete_files_pattern($1, modules_conf_t, modules_conf_t)
Chris PeBenito 7491a9
')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
########################################
Chris PeBenito 7491a9
## <summary>
Chris PeBenito 7491a9
##	Manage files with the configuration options used when
Chris PeBenito 7491a9
##	loading modules.
Chris PeBenito 7491a9
## </summary>
Chris PeBenito 7491a9
## <param name="domain">
Chris PeBenito 7491a9
##	<summary>
Chris PeBenito 7491a9
##	Domain allowed access.
Chris PeBenito 7491a9
##	</summary>
Chris PeBenito 7491a9
## </param>
Chris PeBenito 7491a9
#
Chris PeBenito 7491a9
interface(`modutils_manage_module_config',`
Chris PeBenito 7491a9
	gen_require(`
Chris PeBenito 7491a9
		type modules_conf_t;
Chris PeBenito 7491a9
	')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
	manage_files_pattern($1, modules_conf_t, modules_conf_t)
Chris PeBenito 36095d
')
Chris PeBenito 36095d
Chris PeBenito 36095d
########################################
Chris PeBenito 36095d
## <summary>
Chris PeBenito 17de1b
##	Unconditionally execute insmod in the insmod domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# cjp: this is added for pppd, due to nested
Chris PeBenito 17de1b
# conditionals not working.
Chris PeBenito 17de1b
interface(`modutils_domtrans_insmod_uncond',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type insmod_t, insmod_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito c0868a
	domtrans_pattern($1, insmod_exec_t, insmod_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute insmod in the insmod domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_domtrans_insmod',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		bool secure_mode_insmod;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	if (!secure_mode_insmod) {
Chris PeBenito 17de1b
		modutils_domtrans_insmod_uncond($1)
Chris PeBenito 17de1b
	}
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute insmod in the insmod domain, and
Chris PeBenito 17de1b
##	allow the specified role the insmod domain,
Chris PeBenito 17de1b
##	and use the caller's terminal.  Has a sigchld
Chris PeBenito 17de1b
##	backchannel.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_run_insmod',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type insmod_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	modutils_domtrans_insmod($1)
Chris PeBenito 17de1b
	role $2 types insmod_t;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute insmod in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_exec_insmod',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type insmod_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito 17de1b
	can_exec($1, insmod_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute depmod in the depmod domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_domtrans_depmod',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type depmod_t, depmod_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito c0868a
	domtrans_pattern($1, depmod_exec_t, depmod_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute depmod in the depmod domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_run_depmod',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 8f3a0a
		type depmod_t, insmod_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	modutils_domtrans_depmod($1)
Chris PeBenito 17de1b
	role $2 types depmod_t;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute depmod in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_exec_depmod',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type depmod_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito 17de1b
	can_exec($1, depmod_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute depmod in the depmod domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_domtrans_update_mods',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type update_modules_t, update_modules_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito c0868a
	domtrans_pattern($1, update_modules_exec_t, update_modules_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute update_modules in the update_modules domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_run_update_mods',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type update_modules_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	modutils_domtrans_update_mods($1)
Chris PeBenito 17de1b
	role $2 types update_modules_t;
Chris PeBenito 36095d
Chris PeBenito 296273
	modutils_run_insmod(update_modules_t, $2)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute update_modules in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`modutils_exec_update_mods',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type update_modules_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito 17de1b
	can_exec($1, update_modules_exec_t)
Chris PeBenito 17de1b
')