Skip to content
Snippets Groups Projects
Commit 538edd33 authored by Stephen Smalley's avatar Stephen Smalley
Browse files

Restrict system_server to only the data file types needed.


Drop rules on data_file_type attribute and replace with rules
on specific types under /data.

Change-Id: I5cbfef64cdd71b8e93478d9ef377689bf6dda192
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
parent 41e14c7f
No related branches found
No related tags found
No related merge requests found
...@@ -167,9 +167,73 @@ allow system_server adbd_socket:sock_file rw_file_perms; ...@@ -167,9 +167,73 @@ allow system_server adbd_socket:sock_file rw_file_perms;
# tun device used for 3rd party vpn apps # tun device used for 3rd party vpn apps
allow system_server tun_device:chr_file rw_file_perms; allow system_server tun_device:chr_file rw_file_perms;
# Manage data files. # Manage system data files.
allow system_server { data_file_type -keystore_data_file }:dir create_dir_perms; allow system_server system_data_file:dir create_dir_perms;
allow system_server { data_file_type -keystore_data_file }:notdevfile_class_set create_file_perms; allow system_server system_data_file:notdevfile_class_set create_file_perms;
# Manage /data/app.
allow system_server apk_data_file:dir create_dir_perms;
allow system_server apk_data_file:file create_file_perms;
allow system_server apk_tmp_file:file create_file_perms;
# Manage /data/app-private.
allow system_server apk_private_data_file:dir create_dir_perms;
allow system_server apk_private_data_file:file create_file_perms;
allow system_server apk_private_tmp_file:file create_file_perms;
# Manage files within asec containers.
allow system_server asec_apk_file:dir create_dir_perms;
allow system_server asec_apk_file:file create_file_perms;
allow system_server asec_public_file:file create_file_perms;
# Manage /data/anr.
allow system_server anr_data_file:dir create_dir_perms;
allow system_server anr_data_file:file create_file_perms;
# Manage /data/backup.
allow system_server backup_data_file:dir create_dir_perms;
allow system_server backup_data_file:file create_file_perms;
# Manage /data/dalvik-cache.
allow system_server dalvikcache_data_file:dir create_dir_perms;
allow system_server dalvikcache_data_file:file create_file_perms;
# Manage /data/misc/adb.
allow system_server adb_keys_file:dir create_dir_perms;
allow system_server adb_keys_file:file create_file_perms;
# Manage /data/misc/sms.
# TODO: Split into a separate type?
allow system_server radio_data_file:dir create_dir_perms;
allow system_server radio_data_file:file create_file_perms;
# Manage /data/misc/systemkeys.
allow system_server systemkeys_data_file:dir create_dir_perms;
allow system_server systemkeys_data_file:file create_file_perms;
# Manage /data/misc/vpn.
allow system_server vpn_data_file:dir create_dir_perms;
allow system_server vpn_data_file:file create_file_perms;
# Manage /data/misc/wifi.
allow system_server wifi_data_file:dir create_dir_perms;
allow system_server wifi_data_file:file create_file_perms;
# Manage /data/misc/zoneinfo.
allow system_server zoneinfo_data_file:dir create_dir_perms;
allow system_server zoneinfo_data_file:file create_file_perms;
# Walk /data/data subdirectories.
# Types extracted from seapp_contexts type= fields.
allow system_server { system_app_data_file bluetooth_data_file nfc_data_file radio_data_file shell_data_file app_data_file }:dir { getattr read search };
# Populate com.android.providers.settings/databases/settings.db.
allow system_server system_app_data_file:dir create_dir_perms;
allow system_server system_app_data_file:file create_file_perms;
# Receive and use open app data files passed over binder IPC.
# Types extracted from seapp_contexts type= fields.
allow system_server { system_app_data_file bluetooth_data_file nfc_data_file radio_data_file shell_data_file app_data_file }:file { getattr read write };
# Read /file_contexts and /data/security/file_contexts # Read /file_contexts and /data/security/file_contexts
security_access_policy(system_server) security_access_policy(system_server)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment