diff --git a/public/shell.te b/public/shell.te index ee8cf2a03057117fa0e195923ee72adb6328ad39..ee498911e02b750b6cc887e3e626caf5c63f9eae 100644 --- a/public/shell.te +++ b/public/shell.te @@ -46,6 +46,7 @@ allow shell input_device:chr_file rw_file_perms; r_dir_file(shell, system_file) allow shell system_file:file x_file_perms; allow shell toolbox_exec:file rx_file_perms; +allow shell tzdatacheck_exec:file rx_file_perms; allow shell shell_exec:file rx_file_perms; allow shell zygote_exec:file rx_file_perms; diff --git a/public/tzdatacheck.te b/public/tzdatacheck.te index 93ae1652973296cd7eaa49da7f2c1755a3b8baec..6f60c8e2a483b5b6d28752c3e2ac211afe259488 100644 --- a/public/tzdatacheck.te +++ b/public/tzdatacheck.te @@ -4,3 +4,15 @@ type tzdatacheck_exec, exec_type, file_type; allow tzdatacheck zoneinfo_data_file:dir create_dir_perms; allow tzdatacheck zoneinfo_data_file:file unlink; + +# Below are strong assertion that only init, system_server and tzdatacheck +# can modify the /data time zone rules directories. This is to make it very +# clear that only these domains should modify the actual time zone rules data. +# The tzdatacheck binary itself may be executed by shell for tests but it must +# not be able to modify the real rules. +# If other users / binaries could modify time zone rules on device this might +# have negative implications for users (who may get incorrect local times) +# or break assumptions made / invalidate data held by the components actually +# responsible for updating time zone rules. +neverallow { domain -system_server -init -tzdatacheck } zoneinfo_data_file:file no_w_file_perms; +neverallow { domain -system_server -init -tzdatacheck } zoneinfo_data_file:dir no_w_dir_perms;