Chris PeBenito e181fe
Chris PeBenito 960373
policy_module(libraries,1.0)
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 b4cd15
files_make_file(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 b4cd15
files_make_file(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 b4cd15
files_make_file(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 b4cd15
type shlib_t;
Chris PeBenito b4cd15
files_make_file(shlib_t)
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#
Chris PeBenito 33bc0d
# texrel_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 33bc0d
type texrel_shlib_t;
Chris PeBenito 33bc0d
files_make_file(texrel_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 48e0db
init_make_system_domain(ldconfig_t,ldconfig_exec_t)
Chris PeBenito 48e0db
role system_r types ldconfig_t;
Chris PeBenito 48e0db
Chris PeBenito 48e0db
allow ldconfig_t ld_so_cache_t:file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito 48e0db
files_create_private_config(ldconfig_t,ld_so_cache_t,file)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
allow ldconfig_t lib_t:dir { getattr search read write add_name remove_name };
Chris PeBenito 48e0db
allow ldconfig_t lib_t:lnk_file { getattr create read unlink };
Chris PeBenito 48e0db
allow ldconfig_t ld_so_t:lnk_file { getattr read };
Chris PeBenito 48e0db
allow ldconfig_t ld_so_t:file { getattr read execute };
Chris PeBenito 48e0db
allow ldconfig_t ld_so_cache_t:file { getattr read };
Chris PeBenito 48e0db
allow ldconfig_t { shlib_t texrel_shlib_t }:lnk_file { getattr read };
Chris PeBenito 48e0db
allow ldconfig_t { shlib_t texrel_shlib_t }:file { getattr read execute };
Chris PeBenito 48e0db
Chris PeBenito 48e0db
kernel_read_system_state(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 763c44
fs_get_persistent_fs_attributes(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
domain_use_widely_inheritable_file_descriptors(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
files_read_general_system_config(ldconfig_t)
Chris PeBenito 48e0db
# for when /etc/ld.so.cache is mislabeled:
Chris PeBenito 48e0db
files_remove_general_system_config(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
init_script_use_pseudoterminal(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
logging_send_system_log_message(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
userdomain_use_all_users_file_descriptors(ldconfig_t)
Chris PeBenito 48e0db
Chris PeBenito 48e0db
Chris PeBenito 48e0db
ifdef(`TODO',`
Chris PeBenito 48e0db
Chris PeBenito 48e0db
allow ldconfig_t tmp_t:dir search;
Chris PeBenito 48e0db
Chris PeBenito 48e0db
ifdef(`apache.te', `
Chris PeBenito 0c73cd
	# dontaudit access to /usr/lib/apache, normal programs cannot read these libs anyway
Chris PeBenito 0c73cd
	dontaudit ldconfig_t httpd_modules_t:dir search;
Chris PeBenito 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito 48e0db
allow ldconfig_t { var_t var_lib_t }:dir search;
Chris PeBenito 48e0db
Chris PeBenito 48e0db
ifdef(`hide_broken_symptoms', `
Chris PeBenito 0c73cd
	ifdef(`unconfined.te',`
Chris PeBenito 0c73cd
		dontaudit ldconfig_t unconfined_t:tcp_socket { read write };
Chris PeBenito 0c73cd
	')
Chris PeBenito 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito 48e0db
ifdef(`targeted_policy', `
Chris PeBenito 0c73cd
	allow ldconfig_t lib_t:file r_file_perms;
Chris PeBenito 0c73cd
	unconfined_domain(ldconfig_t) 
Chris PeBenito 48e0db
')
Chris PeBenito 48e0db
Chris PeBenito 48e0db
') dnl end TODO