platform_system_sepolicy/recovery_persist.te
Mark Salyzyn 05806470b7 Add recovery_persist & recovery_refresh
(cherry pick from commit 16fe52c90c)

One time executables. recovery_refresh can be used at any time to
ensure recovery logs in pmsg are re-placed at the end of the FIFO.
recovery_persist takes the recovery logs in pmsg and drops them
into /data/misc/recovery/ directory.

Bug: 27176738
Change-Id: Ife3cf323930fb7a6a5d1704667961f9d42bfc5ac
2016-03-24 12:48:26 -07:00

31 lines
1 KiB
Text

# android recovery persistent log manager
type recovery_persist, domain;
type recovery_persist_exec, exec_type, file_type;
init_daemon_domain(recovery_persist)
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;
# recovery_persist is not allowed to write anywhere other than recovery_data_file
neverallow recovery_persist { file_type -recovery_data_file -recovery_persist_tmpfs userdebug_or_eng(`-coredump_file') }:file write;