Skip to content
Snippets Groups Projects
Commit 062236a8 authored by Alex Klyubin's avatar Alex Klyubin
Browse files

Remove access to ro.runtime.firstboot from apps

ro.runtime.firstboot system property is only used internally by
system_server to distinguish between first start after boot from
consecutive starts (for example, this happens when full-disk
encryption is enabled). The value of the property is a
millisecond-precise timestamp which can help track individual
device. Thus apps should not have access to this property.

Test: Device boots fine, reading ro.runtime.firstboot from an app results in an error and SELinux denial.
Bug: 33700679
Change-Id: I4c3c26a35c5dd840bced3a3e53d071f45317f63c
parent b8bb1d4c
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ persist.radio u:object_r:radio_prop:s0 ...@@ -18,6 +18,7 @@ persist.radio u:object_r:radio_prop:s0
net. u:object_r:system_prop:s0 net. u:object_r:system_prop:s0
dev. u:object_r:system_prop:s0 dev. u:object_r:system_prop:s0
ro.runtime. u:object_r:system_prop:s0 ro.runtime. u:object_r:system_prop:s0
ro.runtime.firstboot u:object_r:firstboot_prop:s0
hw. u:object_r:system_prop:s0 hw. u:object_r:system_prop:s0
ro.hw. u:object_r:system_prop:s0 ro.hw. u:object_r:system_prop:s0
sys. u:object_r:system_prop:s0 sys. u:object_r:system_prop:s0
......
...@@ -386,6 +386,9 @@ neverallow { ...@@ -386,6 +386,9 @@ neverallow {
-system_server -system_server
} serialno_prop:file r_file_perms; } serialno_prop:file r_file_perms;
# Do not allow reading the last boot timestamp from system properties
neverallow { domain -init -system_server } firstboot_prop:file r_file_perms;
neverallow { neverallow {
domain domain
-init -init
......
...@@ -21,6 +21,7 @@ type dumpstate_options_prop, property_type; ...@@ -21,6 +21,7 @@ type dumpstate_options_prop, property_type;
type dumpstate_prop, property_type, core_property_type; type dumpstate_prop, property_type, core_property_type;
type ffs_prop, property_type, core_property_type; type ffs_prop, property_type, core_property_type;
type fingerprint_prop, property_type, core_property_type; type fingerprint_prop, property_type, core_property_type;
type firstboot_prop, property_type;
type hwservicemanager_prop, property_type; type hwservicemanager_prop, property_type;
type logd_prop, property_type, core_property_type; type logd_prop, property_type, core_property_type;
type logpersistd_logging_prop, property_type; type logpersistd_logging_prop, property_type;
......
...@@ -391,6 +391,9 @@ get_prop(system_server, boottime_prop) ...@@ -391,6 +391,9 @@ get_prop(system_server, boottime_prop)
# Read device's serial number from system properties # Read device's serial number from system properties
get_prop(system_server, serialno_prop) get_prop(system_server, serialno_prop)
# Read/write the property which keeps track of whether this is the first start of system_server
set_prop(system_server, firstboot_prop)
# Create a socket for receiving info from wpa. # Create a socket for receiving info from wpa.
allow system_server wpa_socket:dir rw_dir_perms; allow system_server wpa_socket:dir rw_dir_perms;
allow system_server system_wpa_socket:sock_file create_file_perms; allow system_server system_wpa_socket:sock_file create_file_perms;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment