From 9322cb088a4d1edcf010aab0809bb0c1a906c73d Mon Sep 17 00:00:00 2001 From: Shuo Qian Date: Tue, 15 Oct 2019 13:13:56 -0700 Subject: [PATCH] Setting up SELinux policy for Emergency number database Test: Manual; https://paste.googleplex.com/6222197494382592 Bug: 136027884 Change-Id: I29214de6b5b5a62bff246c1256567844f4ce55c7 --- private/file.te | 3 +++ private/file_contexts | 1 + private/radio.te | 4 ++++ private/system_server.te | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/private/file.te b/private/file.te index 010b7cf85..09bfe29e6 100644 --- a/private/file.te +++ b/private/file.te @@ -26,3 +26,6 @@ type linkerconfig_file, file_type; # /data/gsi/ota type ota_image_data_file, file_type, data_file_type, core_data_file_type; + +# /data/misc/emergencynumberdb +type emergency_data_file, file_type, data_file_type, core_data_file_type; diff --git a/private/file_contexts b/private/file_contexts index 8c67e1fa8..9b7bdcc1d 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -508,6 +508,7 @@ /data/misc/carrierid(/.*)? u:object_r:radio_data_file:s0 /data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 /data/misc/dhcp-6\.8\.2(/.*)? u:object_r:dhcp_data_file:s0 +/data/misc/emergencynumberdb(/.*)? u:object_r:emergency_data_file:s0 /data/misc/gatekeeper(/.*)? u:object_r:gatekeeper_data_file:s0 /data/misc/incidents(/.*)? u:object_r:incident_data_file:s0 /data/misc/installd(/.*)? u:object_r:install_data_file:s0 diff --git a/private/radio.te b/private/radio.te index b6b7b8eac..a86403e6e 100644 --- a/private/radio.te +++ b/private/radio.te @@ -8,3 +8,7 @@ read_runtime_log_tags(radio) get_prop(radio, time_prop) allow radio uce_service:service_manager find; + +# Manage /data/misc/emergencynumberdb +allow radio emergency_data_file:dir r_dir_perms; +allow radio emergency_data_file:file r_file_perms; diff --git a/private/system_server.te b/private/system_server.te index a7f9b130d..84f5bc7d1 100644 --- a/private/system_server.te +++ b/private/system_server.te @@ -443,6 +443,10 @@ allow system_server heapdump_data_file:file create_file_perms; allow system_server adb_keys_file:dir create_dir_perms; allow system_server adb_keys_file:file create_file_perms; +# Manage /data/misc/emergencynumberdb +allow system_server emergency_data_file:dir create_dir_perms; +allow system_server emergency_data_file:file create_file_perms; + # Manage /data/misc/network_watchlist allow system_server network_watchlist_data_file:dir create_dir_perms; allow system_server network_watchlist_data_file:file create_file_perms;