Chris PeBenito e181fe
Chris PeBenito 0e1c46
policy_module(libraries,1.3.5)
Chris PeBenito 960373
Chris PeBenito 48e0db
########################################
Chris PeBenito 48e0db
#
Chris PeBenito 48e0db
# Declarations
Chris PeBenito 48e0db
#
Chris PeBenito 48e0db
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# ld_so_cache_t is the type of /etc/ld.so.cache.
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type ld_so_cache_t;
Chris PeBenito 8fd367
files_type(ld_so_cache_t)
Chris PeBenito b4cd15
Chris PeBenito 48e0db
#
Chris PeBenito b4cd15
# ld_so_t is the type of the system dynamic loaders.
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type ld_so_t;
Chris PeBenito 8fd367
files_type(ld_so_t)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# lib_t is the type of files in the system lib directories.
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
type lib_t;
Chris PeBenito 8fd367
files_type(lib_t)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# shlib_t is the type of shared objects in the system lib
Chris PeBenito b4cd15
# directories.
Chris PeBenito b4cd15
#
Chris PeBenito 33faf5
ifdef(`targeted_policy',`
Chris PeBenito 33faf5
	typealias lib_t alias shlib_t;
Chris PeBenito 33faf5
',`
Chris PeBenito 33faf5
	type shlib_t;
Chris PeBenito 33faf5
	files_type(shlib_t)
Chris PeBenito 33faf5
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito 0c4bf1
# textrel_shlib_t is the type of shared objects in the system lib
Chris PeBenito b4cd15
# directories, which require text relocation.
Chris PeBenito b4cd15
#
Chris PeBenito a324ef
type textrel_shlib_t alias texrel_shlib_t;
Chris PeBenito a324ef
files_type(textrel_shlib_t)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
########################################
Chris PeBenito 48e0db
#
Chris PeBenito 48e0db
# ldconfig local policy
Chris PeBenito 48e0db
#
Chris PeBenito 48e0db
type ldconfig_t;
Chris PeBenito 48e0db
type ldconfig_exec_t;
Chris PeBenito c9428d
init_system_domain(ldconfig_t,ldconfig_exec_t)
Chris PeBenito 48e0db
role system_r types ldconfig_t;
Chris PeBenito 48e0db
Chris PeBenito dd8229
allow ldconfig_t ld_so_cache_t:file create_file_perms;
Chris PeBenito 103fe2
files_etc_filetrans(ldconfig_t,ld_so_cache_t,file)
Chris PeBenito 48e0db
Chris PeBenito dd8229
allow ldconfig_t lib_t:dir rw_dir_perms;
Chris PeBenito 48e0db
allow ldconfig_t lib_t:lnk_file { getattr create read unlink };
Chris PeBenito dd8229
allow ldconfig_t ld_so_t:lnk_file r_file_perms;
Chris PeBenito dd8229
allow ldconfig_t ld_so_t:file rx_file_perms;
Chris PeBenito dd8229
allow ldconfig_t ld_so_cache_t:file r_file_perms;
Chris PeBenito a324ef
allow ldconfig_t { shlib_t textrel_shlib_t }:lnk_file r_file_perms;
Chris PeBenito a324ef
allow ldconfig_t { shlib_t textrel_shlib_t }:file rx_file_perms;
Chris PeBenito 48e0db
Chris PeBenito 48e0db
kernel_read_system_state(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 15722e
domain_use_interactive_fds(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 7a2f20
files_search_var_lib(ldconfig_t)
Chris PeBenito 8fd367
files_read_etc_files(ldconfig_t)
Chris PeBenito ebdc3b
files_search_tmp(ldconfig_t)
Chris PeBenito b0d224
files_search_usr(ldconfig_t)
Chris PeBenito 48e0db
# for when /etc/ld.so.cache is mislabeled:
Chris PeBenito 8fd367
files_delete_etc_files(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 1815ba
init_use_script_ptys(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito c9428d
logging_send_syslog_msg(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 15722e
userdom_use_all_users_fds(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito a42ca7
ifdef(`hide_broken_symptoms',`
Chris PeBenito bb7170
	optional_policy(`
Chris PeBenito 1815ba
		unconfined_dontaudit_rw_tcp_sockets(ldconfig_t)
Chris PeBenito 0c73cd
	')
Chris PeBenito 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito a42ca7
ifdef(`targeted_policy',`
Chris PeBenito 0c73cd
	allow ldconfig_t lib_t:file r_file_perms;
Chris PeBenito 955019
	unconfined_domain(ldconfig_t) 
Chris PeBenito 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito a42ca7
	# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
Chris PeBenito c6d4c8
	apache_dontaudit_search_modules(ldconfig_t)
Chris PeBenito a42ca7
')