Chris PeBenito 17de1b
Chris PeBenito d9845a
policy_module(libraries,1.4.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# ld_so_cache_t is the type of /etc/ld.so.cache.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type ld_so_cache_t;
Chris PeBenito 17de1b
files_type(ld_so_cache_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# ld_so_t is the type of the system dynamic loaders.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type ld_so_t;
Chris PeBenito 17de1b
files_type(ld_so_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# lib_t is the type of files in the system lib directories.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type lib_t;
Chris PeBenito 17de1b
files_type(lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# shlib_t is the type of shared objects in the system lib
Chris PeBenito 17de1b
# directories.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	typealias lib_t alias shlib_t;
Chris PeBenito 17de1b
',`
Chris PeBenito 17de1b
	type shlib_t;
Chris PeBenito 17de1b
	files_type(shlib_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# textrel_shlib_t is the type of shared objects in the system lib
Chris PeBenito 17de1b
# directories, which require text relocation.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type textrel_shlib_t alias texrel_shlib_t;
Chris PeBenito 17de1b
files_type(textrel_shlib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# ldconfig local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type ldconfig_t;
Chris PeBenito 17de1b
type ldconfig_exec_t;
Chris PeBenito 17de1b
init_system_domain(ldconfig_t,ldconfig_exec_t)
Chris PeBenito 17de1b
role system_r types ldconfig_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow ldconfig_t ld_so_cache_t:file create_file_perms;
Chris PeBenito 17de1b
files_etc_filetrans(ldconfig_t,ld_so_cache_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow ldconfig_t lib_t:dir rw_dir_perms;
Chris PeBenito 17de1b
allow ldconfig_t lib_t:lnk_file { getattr create read unlink };
Chris PeBenito 17de1b
allow ldconfig_t ld_so_t:lnk_file r_file_perms;
Chris PeBenito 17de1b
allow ldconfig_t ld_so_t:file rx_file_perms;
Chris PeBenito 17de1b
allow ldconfig_t ld_so_cache_t:file r_file_perms;
Chris PeBenito 17de1b
allow ldconfig_t { shlib_t textrel_shlib_t }:lnk_file r_file_perms;
Chris PeBenito 17de1b
allow ldconfig_t { shlib_t textrel_shlib_t }:file rx_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_xattr_fs(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_search_var_lib(ldconfig_t)
Chris PeBenito 17de1b
files_read_etc_files(ldconfig_t)
Chris PeBenito 17de1b
files_search_tmp(ldconfig_t)
Chris PeBenito 17de1b
files_search_usr(ldconfig_t)
Chris PeBenito 17de1b
# for when /etc/ld.so.cache is mislabeled:
Chris PeBenito 17de1b
files_delete_etc_files(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_script_ptys(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_use_all_users_fds(ldconfig_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`hide_broken_symptoms',`
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		unconfined_dontaudit_rw_tcp_sockets(ldconfig_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	allow ldconfig_t lib_t:file r_file_perms;
Chris PeBenito 17de1b
	unconfined_domain(ldconfig_t) 
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
Chris PeBenito 17de1b
	apache_dontaudit_search_modules(ldconfig_t)
Chris PeBenito 17de1b
')