|
Chris PeBenito |
e181fe |
# Copyright (C) 2005 Tresys Technology, LLC
|
|
Chris PeBenito |
48e0db |
## <module name="libraries" layer="system">
|
|
Chris PeBenito |
48e0db |
## <summary>Policy for system libraries.</summary>
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
########################################
|
|
Chris PeBenito |
48e0db |
## <interface name="libraries_ldconfig_transition">
|
|
Chris PeBenito |
48e0db |
## <description>
|
|
Chris PeBenito |
48e0db |
## Execute ldconfig in the ldconfig domain.
|
|
Chris PeBenito |
48e0db |
## </description>
|
|
Chris PeBenito |
48e0db |
## <parameter name="domain">
|
|
Chris PeBenito |
48e0db |
## The type of the process performing this action.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <infoflow type="write" weight="10"/>
|
|
Chris PeBenito |
48e0db |
## </interface>
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition',`
|
|
Chris PeBenito |
48e0db |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
allow $1 ldconfig_exec_t:file { getattr read execute };
|
|
Chris PeBenito |
48e0db |
allow $1 ldconfig_t:process transition;
|
|
Chris PeBenito |
e7fcdc |
type_transition $1 ldconfig_exec_t:process ldconfig_t;
|
|
Chris PeBenito |
48e0db |
dontaudit $1 ldconfig_t:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition_depend',`
|
|
Chris PeBenito |
48e0db |
type ldconfig_t, ldconfig_exec_t;
|
|
Chris PeBenito |
48e0db |
class file { getattr read execute };
|
|
Chris PeBenito |
48e0db |
class process { transition noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
########################################
|
|
Chris PeBenito |
48e0db |
## <interface name="libraries_ldconfig_transition_add_role_use_terminal">
|
|
Chris PeBenito |
48e0db |
## <description>
|
|
Chris PeBenito |
48e0db |
## Execute ldconfig in the ldconfig domain.
|
|
Chris PeBenito |
48e0db |
## </description>
|
|
Chris PeBenito |
48e0db |
## <parameter name="domain">
|
|
Chris PeBenito |
48e0db |
## The type of the process performing this action.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <parameter name="role">
|
|
Chris PeBenito |
48e0db |
## The role to allow the ldconfig domain.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <parameter name="terminal">
|
|
Chris PeBenito |
48e0db |
## The type of the terminal allow the ldconfig domain to use.
|
|
Chris PeBenito |
48e0db |
## </parameter>
|
|
Chris PeBenito |
48e0db |
## <infoflow type="both" weight="10"/>
|
|
Chris PeBenito |
48e0db |
## </interface>
|
|
Chris PeBenito |
48e0db |
#
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition_add_role_use_terminal',`
|
|
Chris PeBenito |
48e0db |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
libraries_ldconfig_transition($1)
|
|
Chris PeBenito |
48e0db |
role $2 types ldconfig_t;
|
|
Chris PeBenito |
48e0db |
allow ldconfig_t $3:chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
48e0db |
|
|
Chris PeBenito |
48e0db |
define(`libraries_ldconfig_transition_add_role_use_terminal_depend',`
|
|
Chris PeBenito |
48e0db |
type ldconfig_t;
|
|
Chris PeBenito |
48e0db |
class chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
48e0db |
')
|
|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_use_dynamic_loader">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Use the dynamic link/loader for automatic loading
|
|
Chris PeBenito |
f5c42b |
## of shared libraries.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_use_dynamic_loader',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
f5c42b |
files_read_general_system_config_directory($1)
|
|
Chris PeBenito |
48e0db |
allow $1 lib_t:dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
219bcf |
allow $1 ld_so_t:lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 ld_so_t:file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
allow $1 ld_so_cache_t:file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_use_dynamic_loader_depend',`
|
|
Chris PeBenito |
b4cd15 |
type lib_t, ld_so_t, ld_so_cache_t;
|
|
Chris PeBenito |
48e0db |
class dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_legacy_use_dynamic_loader">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Use the dynamic link/loader for automatic loading
|
|
Chris PeBenito |
f5c42b |
## of shared libraries with legacy support.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
8beec8 |
#
|
|
Chris PeBenito |
8beec8 |
define(`libraries_legacy_use_dynamic_loader',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
f5c42b |
libraries_use_dynamic_loader($1)
|
|
Chris PeBenito |
8beec8 |
allow $1 ld_so_t:file execmod;
|
|
Chris PeBenito |
8beec8 |
allow $1 ld_so_cache_t:file execute;
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
8beec8 |
define(`libraries_legacy_use_dynamic_loader_depend',`
|
|
Chris PeBenito |
8beec8 |
type ld_so_t, ld_so_cache_t;
|
|
Chris PeBenito |
8beec8 |
class file { execute execmod };
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
8beec8 |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_execute_dynamic_loader">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Execute the dynamic link/loader in the caller's
|
|
Chris PeBenito |
f5c42b |
## domain. This is commonly needed for the
|
|
Chris PeBenito |
f5c42b |
## /usr/bin/ldd program. Note: this can be used
|
|
Chris PeBenito |
f5c42b |
## to execute any binary that the caller can
|
|
Chris PeBenito |
f5c42b |
## read, even if the caller does not have execute
|
|
Chris PeBenito |
f5c42b |
## permissions.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
075c4f |
define(`libraries_execute_dynamic_loader',`
|
|
Chris PeBenito |
075c4f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
48e0db |
allow $1 lib_t:dir { getattr search read };
|
|
Chris PeBenito |
075c4f |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
075c4f |
allow $1 ld_so_t:lnk_file { getattr read };
|
|
Chris PeBenito |
075c4f |
allow $1 ld_so_t:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
define(`libraries_execute_dynamic_loader_depend',`
|
|
Chris PeBenito |
075c4f |
type lib_t, ld_so_t;
|
|
Chris PeBenito |
48e0db |
class dir { getattr search read };
|
|
Chris PeBenito |
075c4f |
class lnk_file { getattr read };
|
|
Chris PeBenito |
075c4f |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_modify_dynamic_loader_cache">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Modify the dynamic link/loader's cached listing
|
|
Chris PeBenito |
f5c42b |
## of shared libraries.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="both" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_modify_dynamic_loader_cache',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
f5c42b |
files_read_general_system_config_directory($1)
|
|
Chris PeBenito |
b4cd15 |
allow $1 ld_so_cache_t:file { getattr read write };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`libraries_modify_dynamic_loader_cache_depend',`
|
|
Chris PeBenito |
b4cd15 |
type ld_so_cache_t;
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read write };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_read_library_resources">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Read files in the library directories, such
|
|
Chris PeBenito |
f5c42b |
## as static libraries.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
f5c42b |
define(`libraries_read_library_resources',`
|
|
Chris PeBenito |
f5c42b |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
f5c42b |
allow $1 lib_t:dir { getattr read search };
|
|
Chris PeBenito |
f5c42b |
allow $1 lib_t:{ file lnk_file } { getattr read };
|
|
Chris PeBenito |
f5c42b |
')
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
f5c42b |
define(`libraries_read_library_resources_depend',`
|
|
Chris PeBenito |
f5c42b |
type lib_t;
|
|
Chris PeBenito |
f5c42b |
class dir { getattr read search };
|
|
Chris PeBenito |
f5c42b |
class lnk_file { getattr read };
|
|
Chris PeBenito |
f5c42b |
class file { getattr read };
|
|
Chris PeBenito |
f5c42b |
')
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
f5c42b |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_execute_library_scripts">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Execute library scripts in the caller domain.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
f5c42b |
#
|
|
Chris PeBenito |
f5c42b |
define(`libraries_execute_library_scripts',`
|
|
Chris PeBenito |
f5c42b |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
f5c42b |
allow $1 lib_t:dir { getattr read search };
|
|
Chris PeBenito |
f5c42b |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
f5c42b |
allow $1 lib_t:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
f5c42b |
')
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
f5c42b |
define(`libraries_execute_library_scripts_depend',`
|
|
Chris PeBenito |
f5c42b |
type lib_t;
|
|
Chris PeBenito |
f5c42b |
class dir { getattr read search };
|
|
Chris PeBenito |
f5c42b |
class lnk_file { getattr read };
|
|
Chris PeBenito |
f5c42b |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
f5c42b |
')
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
f5c42b |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_use_shared_libraries">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Load and execute functions from shared libraries.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_use_shared_libraries',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
efd8ed |
files_search_general_application_resources_dir($1)
|
|
Chris PeBenito |
48e0db |
allow $1 lib_t:dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 lib_t:lnk_file { getattr read };
|
|
Chris PeBenito |
219bcf |
allow $1 { shlib_t texrel_shlib_t }:lnk_file { getattr read };
|
|
Chris PeBenito |
33bc0d |
allow $1 { shlib_t texrel_shlib_t }:file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_use_shared_libraries_depend',`
|
|
Chris PeBenito |
33bc0d |
type lib_t, shlib_t, texrel_shlib_t;
|
|
Chris PeBenito |
48e0db |
class dir { getattr searc read };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
f5c42b |
## <interface name="libraries_legacy_use_shared_libraries">
|
|
Chris PeBenito |
f5c42b |
## <description>
|
|
Chris PeBenito |
f5c42b |
## Load and execute functions from shared libraries,
|
|
Chris PeBenito |
f5c42b |
## with legacy support.
|
|
Chris PeBenito |
f5c42b |
## </description>
|
|
Chris PeBenito |
f5c42b |
## <parameter name="domain">
|
|
Chris PeBenito |
f5c42b |
## The type of the process performing this action.
|
|
Chris PeBenito |
f5c42b |
## </parameter>
|
|
Chris PeBenito |
f5c42b |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
f5c42b |
## </interface>
|
|
Chris PeBenito |
8beec8 |
#
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_legacy_use_shared_libraries',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
dd14d0 |
libraries_use_shared_libraries($1)
|
|
Chris PeBenito |
8beec8 |
allow $1 { shlib_t texrel_shlib_t }:file execmod;
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
dd14d0 |
define(`libraries_legacy_use_shared_libraries_depend',`
|
|
Chris PeBenito |
8beec8 |
type shlib_t, texrel_shlib_t;
|
|
Chris PeBenito |
8beec8 |
class file execmod;
|
|
Chris PeBenito |
8beec8 |
')
|
|
Chris PeBenito |
8beec8 |
|
|
Chris PeBenito |
48e0db |
## </module>
|