From b794ad0f8d81341c89b040bced2933224bff04a4 Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Mon, 25 Jun 2018 15:36:51 +0100 Subject: [PATCH] Add label for time (zone) system properties This adds a label for system properties that will affect system-wide time / time detection logic. The first example will be something like: persist.time.detection_impl_version Bug: 78217059 Test: build Change-Id: I46044f1e28170760001da9acf2496a1e3037e48a --- private/compat/26.0/26.0.ignore.cil | 1 + private/compat/27.0/27.0.ignore.cil | 1 + private/property_contexts | 3 +++ private/radio.te | 3 +++ private/system_server.te | 3 +++ public/property.te | 2 ++ 6 files changed, 13 insertions(+) diff --git a/private/compat/26.0/26.0.ignore.cil b/private/compat/26.0/26.0.ignore.cil index ebd4037dc..79cadf8f4 100644 --- a/private/compat/26.0/26.0.ignore.cil +++ b/private/compat/26.0/26.0.ignore.cil @@ -118,6 +118,7 @@ thermalserviced thermalserviced_exec thermalserviced_tmpfs + time_prop timedetector_service timezone_service timezonedetector_service diff --git a/private/compat/27.0/27.0.ignore.cil b/private/compat/27.0/27.0.ignore.cil index fe9887e8e..3b3f6f814 100644 --- a/private/compat/27.0/27.0.ignore.cil +++ b/private/compat/27.0/27.0.ignore.cil @@ -95,6 +95,7 @@ system_boot_reason_prop system_update_service test_boot_reason_prop + time_prop timedetector_service timezonedetector_service tombstone_wifi_data_file diff --git a/private/property_contexts b/private/property_contexts index 8befae52a..6ebad3591 100644 --- a/private/property_contexts +++ b/private/property_contexts @@ -146,3 +146,6 @@ odm. u:object_r:vendor_default_prop:s0 persist.odm. u:object_r:vendor_default_prop:s0 persist.vendor. u:object_r:vendor_default_prop:s0 vendor. u:object_r:vendor_default_prop:s0 + +# Properties that relate to time / time zone detection behavior. +persist.time. u:object_r:time_prop:s0 diff --git a/private/radio.te b/private/radio.te index b4f539048..9ac2cf17f 100644 --- a/private/radio.te +++ b/private/radio.te @@ -3,3 +3,6 @@ typeattribute radio coredomain; app_domain(radio) read_runtime_log_tags(radio) + +# Telephony code contains time / time zone detection logic so it reads the associated properties. +get_prop(radio, time_prop) diff --git a/private/system_server.te b/private/system_server.te index d3b8bcd33..d7bf54aa7 100644 --- a/private/system_server.te +++ b/private/system_server.te @@ -795,6 +795,9 @@ userdebug_or_eng(` allow system_server functionfs:dir search; allow system_server functionfs:file rw_file_perms; +# system_server contains time / time zone detection logic so reads the associated properties. +get_prop(system_server, time_prop) + ### ### Neverallow rules ### diff --git a/public/property.te b/public/property.te index 8113b82a9..e399a5f4c 100644 --- a/public/property.te +++ b/public/property.te @@ -59,6 +59,7 @@ type system_boot_reason_prop, property_type; type system_prop, property_type, core_property_type; type system_radio_prop, property_type, core_property_type; type test_boot_reason_prop, property_type; +type time_prop, property_type; type traced_enabled_prop, property_type; type vold_prop, property_type, core_property_type; type wifi_log_prop, property_type, log_property_type; @@ -402,6 +403,7 @@ compatible_property_only(` -system_prop -system_radio_prop -test_boot_reason_prop + -time_prop -traced_enabled_prop -vendor_default_prop -vendor_security_patch_level_prop