platform_system_sepolicy/public/recovery_persist.te
dcashman 2e00e6373f sepolicy: add version_policy tool and version non-platform policy.
In order to support platform changes without simultaneous updates from
non-platform components, the platform and non-platform policies must be
split.  In order to provide a guarantee that policy written for
non-platform objects continues to provide the same access, all types
exposed to non-platform policy are versioned by converting them and the
policy using them into attributes.

This change performs that split, the subsequent versioning and also
generates a mapping file to glue the different policy components
together.

Test: Device boots and runs.
Bug: 31369363
Change-Id: Ibfd3eb077bd9b8e2ff3b2e6a0ca87e44d78b1317
2016-12-06 08:56:02 -08:00

27 lines
799 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 { app_data_file system_data_file }:dir_file_class_set write;