|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
a324ef |
policy_module(libraries,1.1.2)
|
|
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 |
c6d4c8 |
kernel_use_ld_so_from(lib_t,ld_so_t,ld_so_cache_t)
|
|
Chris PeBenito |
a324ef |
kernel_use_shared_libs_from(lib_t,{ shlib_t textrel_shlib_t })
|
|
Chris PeBenito |
c6d4c8 |
|
|
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 |
c9428d |
files_create_etc_config(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 |
c9428d |
domain_use_wide_inherit_fd(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 |
48e0db |
# for when /etc/ld.so.cache is mislabeled:
|
|
Chris PeBenito |
8fd367 |
files_delete_etc_files(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
init_use_script_pty(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
logging_send_syslog_msg(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
c9428d |
userdom_use_all_user_fd(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
a42ca7 |
ifdef(`hide_broken_symptoms',`
|
|
Chris PeBenito |
132880 |
optional_policy(`unconfined',`
|
|
Chris PeBenito |
a42ca7 |
unconfined_dontaudit_rw_tcp_socket(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 |
a42ca7 |
unconfined_domain_template(ldconfig_t)
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
132880 |
optional_policy(`apache',`
|
|
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 |
')
|