sepolicy/recovery: Add rules for magisk package
Change-Id: I18758628690c0cdb9435259093859cb1a932cf83
diff --git a/common/private/recovery.te b/common/private/recovery.te
index b581957..9f044da 100644
--- a/common/private/recovery.te
+++ b/common/private/recovery.te
@@ -1,4 +1,16 @@
recovery_only(`
# Enable adb root
set_prop(recovery, adbd_private_prop)
+
+# Magisk
+allow recovery apex_mnt_dir:dir mounton;
+allow recovery cache_file:file x_file_perms;
+allow recovery { apex_mnt_dir device rootfs }:dir create_dir_perms;
+allow recovery device:file { create_file_perms x_file_perms };
+allow recovery { init kernel vendor_init ueventd persist_data_file }:dir r_dir_perms;
+allow recovery { init kernel vendor_init ueventd }:file r_file_perms;
+allow recovery random_device:chr_file mounton;
+allow recovery exec_type:{ file lnk_file } r_file_perms;
+allow recovery loop_device:blk_file ioctl;
+allowxperm recovery loop_device:blk_file ioctl LOOP_CLR_FD;
')