blob: 463f098bdd34302646c776c9e2e9992c00be6acf [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute init coredomain;
2
dcashmancc39f632016-07-22 13:13:11 -07003tmpfs_domain(init)
4
5# Transitions to seclabel processes in init.rc
Sandeep Patil137a13d2016-12-15 12:36:45 -08006domain_trans(init, rootfs, healthd)
dcashmancc39f632016-07-22 13:13:11 -07007domain_trans(init, rootfs, slideshow)
Tao Baoecc7e8c2018-09-07 15:05:33 -07008domain_auto_trans(init, charger_exec, charger)
Jin Qian4de505b2017-05-02 13:45:08 -07009domain_auto_trans(init, e2fs_exec, e2fs)
Joel Fernandes147cf642018-11-29 13:07:40 -080010domain_auto_trans(init, bpfloader_exec, bpfloader)
11
dcashmancc39f632016-07-22 13:13:11 -070012recovery_only(`
Tao Baoecc7e8c2018-09-07 15:05:33 -070013 # Files in recovery image are labeled as rootfs.
Bowgo Tsai5846c792017-07-31 18:38:28 +080014 domain_trans(init, rootfs, adbd)
Tao Baoecc7e8c2018-09-07 15:05:33 -070015 domain_trans(init, rootfs, charger)
Jerry Zhang1d85efa2018-05-29 10:54:16 -070016 domain_trans(init, rootfs, fastbootd)
dcashmancc39f632016-07-22 13:13:11 -070017 domain_trans(init, rootfs, recovery)
18')
19domain_trans(init, shell_exec, shell)
20domain_trans(init, init_exec, ueventd)
Tom Cherry621c24c2017-09-28 14:34:36 -070021domain_trans(init, init_exec, vendor_init)
Sandeep Patile41af202017-06-02 16:09:26 -070022domain_trans(init, { rootfs toolbox_exec }, modprobe)
dcashmancc39f632016-07-22 13:13:11 -070023userdebug_or_eng(`
Tom Cherry938ab052018-08-03 10:49:20 -070024 # case where logpersistd is actually logcat -f in logd context (nee: logcatd)
Mark Salyzynda62cb42016-08-10 11:10:02 -070025 domain_auto_trans(init, logcat_exec, logpersist)
Tom Cherry938ab052018-08-03 10:49:20 -070026
27 # allow init to execute services marked with seclabel u:r:su:s0 in userdebug/eng
28 allow init su:process transition;
29 dontaudit init su:process noatsecure;
30 allow init su:process { siginh rlimitinh };
dcashmancc39f632016-07-22 13:13:11 -070031')
Branden Archerd36b1d52018-11-27 15:47:12 -080032
Nikita Ioffe23ba9762019-12-09 21:21:55 +000033# Allow init to figure out name of dm-device from it's /dev/block/dm-XX path.
34# This is useful in case of remounting ext4 userdata into checkpointing mode,
35# since it potentially requires tearing down dm-devices (e.g. dm-bow, dm-crypto)
36# that userdata is mounted onto.
37allow init sysfs_dm:file read;
38
Branden Archerd36b1d52018-11-27 15:47:12 -080039# Allow the BoringSSL self test to request a reboot upon failure
40set_prop(init, powerctl_prop)
Nikita Ioffe7065e462019-11-14 12:59:15 +000041
42# Only init is allowed to set userspace reboot related properties.
43set_prop(init, userspace_reboot_prop)
44set_prop(init, userspace_reboot_exported_prop)
45neverallow { domain -init } userspace_reboot_prop:property_service set;
46neverallow { domain -init } userspace_reboot_exported_prop:property_service set;