2014-01-13 15:45:45 +01:00
|
|
|
# recovery console (used in recovery init.rc for /sbin/recovery)
|
2014-05-29 22:40:15 +02:00
|
|
|
|
|
|
|
# Declare the domain unconditionally so we can always reference it
|
|
|
|
# in neverallow rules.
|
2014-01-13 15:45:45 +01:00
|
|
|
type recovery, domain;
|
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
# But the allow rules are only included in the recovery policy.
|
|
|
|
# Otherwise recovery is only allowed the domain rules.
|
|
|
|
recovery_only(`
|
|
|
|
allow recovery rootfs:file entrypoint;
|
2014-05-31 17:07:39 +02:00
|
|
|
permissive_or_unconfined(recovery)
|
2014-05-29 22:40:15 +02:00
|
|
|
|
|
|
|
# Set security contexts on files that are not known to the loaded policy.
|
|
|
|
allow recovery self:capability2 mac_admin;
|
2014-01-30 19:23:08 +01:00
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
# Mount filesystems.
|
|
|
|
allow recovery fs_type:filesystem *;
|
|
|
|
allow recovery unlabeled:filesystem *;
|
2014-01-13 15:45:45 +01:00
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
# Create and relabel files under /system.
|
|
|
|
allow recovery exec_type:{ file dir lnk_file } { create write setattr relabelfrom relabelto append unlink link rename };
|
|
|
|
allow recovery system_file:{ file dir lnk_file } { create write setattr relabelfrom relabelto append unlink link rename };
|
2014-05-29 20:35:55 +02:00
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
# Required to e.g. wipe userdata/cache.
|
|
|
|
allow recovery dev_type:blk_file rw_file_perms;
|
2014-05-20 20:09:16 +02:00
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
# GUI
|
|
|
|
allow recovery self:process execmem;
|
|
|
|
allow recovery ashmem_device:chr_file execute;
|
2014-02-11 20:40:14 +01:00
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
# Execute /tmp/update_binary.
|
|
|
|
allow recovery tmpfs:file rx_file_perms;
|
2014-05-23 17:26:19 +02:00
|
|
|
|
2014-05-29 22:40:15 +02:00
|
|
|
# Use setfscreatecon() to label files for OTA updates.
|
|
|
|
allow recovery self:process setfscreate;
|
|
|
|
')
|