## Policy for kernel module utilities ###################################### ## ## Getattr the dependencies of kernel modules. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_getattr_module_deps',` gen_require(` type modules_dep_t, modules_object_t; ') getattr_files_pattern($1, modules_object_t, modules_dep_t) ') ######################################## ## ## Read the dependencies of kernel modules. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_read_module_deps_files',` gen_require(` type modules_dep_t; ') allow $1 modules_dep_t:file { map read_file_perms }; ') ######################################## ## ## Read the dependencies of kernel modules. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_read_module_deps',` gen_require(` type modules_dep_t; ') files_list_kernel_modules($1) files_read_kernel_modules($1) allow $1 modules_dep_t:file { map read_file_perms }; ') ######################################## ## ## Read the dependencies of kernel modules. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_delete_module_deps',` gen_require(` type modules_dep_t; ') delete_files_pattern($1, modules_dep_t, modules_dep_t) ') ######################################## ## ## list the configuration options used when ## loading modules. ## ## ## ## Domain allowed access. ## ## ## # interface(`modutils_list_module_config',` gen_require(` type modules_conf_t; ') list_dirs_pattern($1, modules_conf_t, modules_conf_t) ') ######################################## ## ## Read the configuration options used when ## loading modules. ## ## ## ## Domain allowed access. ## ## ## # interface(`modutils_read_module_config',` gen_require(` type modules_conf_t; ') # This file type can be in /etc or # /lib(64)?/modules files_search_etc($1) files_search_boot($1) allow $1 modules_conf_t:dir list_dir_perms; allow $1 modules_conf_t:file read_file_perms; allow $1 modules_conf_t:lnk_file read_lnk_file_perms; ') ######################################## ## ## Rename a file with the configuration options used when ## loading modules. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_rename_module_config',` gen_require(` type modules_conf_t; ') rename_files_pattern($1, modules_conf_t, modules_conf_t) ') ######################################## ## ## Unlink a file with the configuration options used when ## loading modules. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_delete_module_config',` gen_require(` type modules_conf_t; ') delete_files_pattern($1, modules_conf_t, modules_conf_t) ') ######################################## ## ## Manage files with the configuration options used when ## loading modules. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_manage_module_config',` gen_require(` type modules_conf_t; ') manage_files_pattern($1, modules_conf_t, modules_conf_t) ') ######################################## ## ## Execute insmod in the kmod domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`modutils_domtrans_kmod',` gen_require(` type kmod_t, kmod_exec_t; ') corecmd_search_bin($1) domtrans_pattern($1, kmod_exec_t, kmod_t) allow $1 kmod_exec_t:file map; ') ######################################## ## ## Unconditionally execute insmod in the insmod domain. ## ## ## ## Domain allowed to transition. ## ## # # cjp: this is added for pppd, due to nested # conditionals not working. interface(`modutils_domtrans_insmod_uncond',` refpolicywarn(`$0($*) has been deprecated, use modutils_domtrans_kmod() instead.') ') ######################################## ## ## Execute insmod in the insmod domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`modutils_domtrans_insmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_domtrans_kmod() instead.') ') ######################################## ## ## Execute depmod in the depmod domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`modutils_domtrans_depmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_domtrans_kmod() instead.') ') ######################################## ## ## Execute depmod in the depmod domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`modutils_domtrans_update_mods',` refpolicywarn(`$0($*) has been deprecated, use modutils_domtrans_kmod() instead.') ') ######################################## ## ## Allow send signal to insmod. ## ## ## ## Domain allowed to transition. ## ## # interface(`modutils_signal_kmod',` gen_require(` type kmod_t; ') allow $1 kmod_t:process signal; ') ######################################## ## ## Allow send signal to insmod. ## ## ## ## Domain allowed to transition. ## ## # interface(`modutils_signal_insmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_signal_kmod() instead.') ') ######################################## ## ## Execute insmod in the insmod domain, and ## allow the specified role the insmod domain, ## and use the caller's terminal. Has a sigchld ## backchannel. ## ## ## ## Domain allowed to transition. ## ## ## ## ## Role allowed access. ## ## ## # interface(`modutils_run_kmod',` gen_require(` type kmod_t; ') modutils_domtrans_kmod($1) role $2 types kmod_t; ') ######################################## ## ## Execute insmod in the insmod domain, and ## allow the specified role the insmod domain, ## and use the caller's terminal. Has a sigchld ## backchannel. ## ## ## ## Domain allowed to transition. ## ## ## ## ## Role allowed access. ## ## ## # interface(`modutils_run_insmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_run_kmod() instead.') ') ######################################## ## ## Execute depmod in the depmod domain. ## ## ## ## Domain allowed to transition. ## ## ## ## ## Role allowed access. ## ## ## # interface(`modutils_run_depmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_run_kmod() instead.') ') ######################################## ## ## Execute update_modules in the update_modules domain. ## ## ## ## Domain allowed to transition. ## ## ## ## ## Role allowed access. ## ## ## # interface(`modutils_run_update_mods',` refpolicywarn(`$0($*) has been deprecated, use modutils_run_kmod() instead.') ') ####################################### ## ## Execute insmod in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_exec_kmod',` gen_require(` type kmod_exec_t; ') corecmd_search_bin($1) can_exec($1, kmod_exec_t) ') ####################################### ## ## Execute insmod in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_exec_insmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_exec_kmod() instead.') ') ######################################## ## ## Execute depmod in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_exec_depmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_exec_kmod() instead.') ') ######################################## ## ## Execute update_modules in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_exec_update_mods',` refpolicywarn(`$0($*) has been deprecated, use modutils_exec_kmod() instead.') ') ####################################### ## ## Don't audit execute insmod in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_dontaudit_exec_kmod',` gen_require(` type kmod_exec_t; ') dontaudit $1 kmod_exec_t:file exec_file_perms; ') ####################################### ## ## Don't audit execute insmod in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`modutils_dontaudit_exec_insmod',` refpolicywarn(`$0($*) has been deprecated, use modutils_dontaudit_exec_kmod() instead.') ') ######################################## ## ## Transition to modutils named content ## ## ## ## Domain allowed access. ## ## # interface(`modules_filetrans_named_content',` gen_require(` type modules_dep_t; type modules_conf_t; ') files_etc_filetrans($1, modules_conf_t, file, "modprobe.conf") files_etc_filetrans($1, modules_conf_t, file, "modules.conf") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.alias") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.alias.bin") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.block") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.builtin") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.builtin.bin") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.dep") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.dep.bin") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.devname") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.drm") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.modesetting") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.networking") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.order") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.softdep") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.symbols") #files_kernel_modules_filetrans($1, modules_dep_t, file, "modules.symbols.bin") ')