23c9d91b46
Currently, both untrusted apps and priv-apps use the SELinux file label "app_data_file" for files in their /data/data directory. This is problematic, as we really want different rules for such files. For example, we may want to allow untrusted apps to load executable code from priv-app directories, but disallow untrusted apps from loading executable code from their own home directories. This change adds a new file type "privapp_data_file". For compatibility, we adjust the policy to support access privapp_data_files almost everywhere we were previously granting access to app_data_files (adbd and run-as being exceptions). Additional future tightening is possible here by removing some of these newly added rules. This label will start getting used in a followup change to system/sepolicy/private/seapp_contexts, similar to: -user=_app isPrivApp=true domain=priv_app type=app_data_file levelFrom=user +user=_app isPrivApp=true domain=priv_app type=privapp_data_file levelFrom=user For now, this newly introduced label has no usage, so this change is essentially a no-op. Test: Factory reset and boot - no problems on fresh install. Test: Upgrade to new version and test. No compatibility problems on filesystem upgrade. Change-Id: I9618b7d91d1c2bcb5837cdabc949f0cf741a2837
27 lines
817 B
Text
27 lines
817 B
Text
# android recovery persistent log manager
|
|
type recovery_persist, domain;
|
|
type recovery_persist_exec, exec_type, file_type;
|
|
|
|
allow recovery_persist pstorefs:dir search;
|
|
allow recovery_persist pstorefs:file r_file_perms;
|
|
|
|
allow recovery_persist recovery_data_file:file create_file_perms;
|
|
allow recovery_persist recovery_data_file:dir create_dir_perms;
|
|
|
|
###
|
|
### Neverallow rules
|
|
###
|
|
### recovery_persist should NEVER do any of this
|
|
|
|
# Block device access.
|
|
neverallow recovery_persist dev_type:blk_file { read write };
|
|
|
|
# ptrace any other app
|
|
neverallow recovery_persist domain:process ptrace;
|
|
|
|
# Write to /system.
|
|
neverallow recovery_persist system_file:dir_file_class_set write;
|
|
|
|
# Write to files in /data/data
|
|
neverallow recovery_persist { privapp_data_file app_data_file system_data_file }:dir_file_class_set write;
|
|
|