Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 1 | typeattribute init coredomain; |
| 2 | |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 3 | tmpfs_domain(init) |
| 4 | |
| 5 | # Transitions to seclabel processes in init.rc |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 6 | domain_trans(init, rootfs, slideshow) |
Tao Bao | ecc7e8c | 2018-09-07 15:05:33 -0700 | [diff] [blame] | 7 | domain_auto_trans(init, charger_exec, charger) |
Jin Qian | 4de505b | 2017-05-02 13:45:08 -0700 | [diff] [blame] | 8 | domain_auto_trans(init, e2fs_exec, e2fs) |
Joel Fernandes | 147cf64 | 2018-11-29 13:07:40 -0800 | [diff] [blame] | 9 | domain_auto_trans(init, bpfloader_exec, bpfloader) |
| 10 | |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 11 | recovery_only(` |
Tao Bao | ecc7e8c | 2018-09-07 15:05:33 -0700 | [diff] [blame] | 12 | # Files in recovery image are labeled as rootfs. |
Bowgo Tsai | 5846c79 | 2017-07-31 18:38:28 +0800 | [diff] [blame] | 13 | domain_trans(init, rootfs, adbd) |
Kelvin Zhang | 19a5785 | 2022-08-30 00:12:26 +0000 | [diff] [blame] | 14 | domain_trans(init, rootfs, hal_bootctl_server) |
Tao Bao | ecc7e8c | 2018-09-07 15:05:33 -0700 | [diff] [blame] | 15 | domain_trans(init, rootfs, charger) |
Jerry Zhang | 1d85efa | 2018-05-29 10:54:16 -0700 | [diff] [blame] | 16 | domain_trans(init, rootfs, fastbootd) |
Sandeep Dhavale | f0ea953 | 2022-11-08 23:57:09 +0000 | [diff] [blame] | 17 | domain_trans(init, rootfs, hal_fastboot_server) |
Yifan Hong | 705db2b | 2021-11-15 18:56:22 -0800 | [diff] [blame] | 18 | domain_trans(init, rootfs, hal_health_server) |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 19 | domain_trans(init, rootfs, recovery) |
Kiyoung Kim | 2c271aa | 2019-12-09 14:57:46 +0900 | [diff] [blame] | 20 | domain_trans(init, rootfs, linkerconfig) |
Yifan Hong | d6b2901 | 2021-11-13 00:22:01 -0800 | [diff] [blame] | 21 | domain_trans(init, rootfs, servicemanager) |
David Anderson | d84b67e | 2021-02-04 12:30:09 -0800 | [diff] [blame] | 22 | domain_trans(init, rootfs, snapuserd) |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 23 | ') |
| 24 | domain_trans(init, shell_exec, shell) |
| 25 | domain_trans(init, init_exec, ueventd) |
Tom Cherry | 621c24c | 2017-09-28 14:34:36 -0700 | [diff] [blame] | 26 | domain_trans(init, init_exec, vendor_init) |
Sandeep Patil | e41af20 | 2017-06-02 16:09:26 -0700 | [diff] [blame] | 27 | domain_trans(init, { rootfs toolbox_exec }, modprobe) |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 28 | userdebug_or_eng(` |
Tom Cherry | 938ab05 | 2018-08-03 10:49:20 -0700 | [diff] [blame] | 29 | # case where logpersistd is actually logcat -f in logd context (nee: logcatd) |
Mark Salyzyn | da62cb4 | 2016-08-10 11:10:02 -0700 | [diff] [blame] | 30 | domain_auto_trans(init, logcat_exec, logpersist) |
Tom Cherry | 938ab05 | 2018-08-03 10:49:20 -0700 | [diff] [blame] | 31 | |
| 32 | # allow init to execute services marked with seclabel u:r:su:s0 in userdebug/eng |
| 33 | allow init su:process transition; |
| 34 | dontaudit init su:process noatsecure; |
| 35 | allow init su:process { siginh rlimitinh }; |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 36 | ') |
Branden Archer | d36b1d5 | 2018-11-27 15:47:12 -0800 | [diff] [blame] | 37 | |
Nikita Ioffe | 23ba976 | 2019-12-09 21:21:55 +0000 | [diff] [blame] | 38 | # Allow init to figure out name of dm-device from it's /dev/block/dm-XX path. |
| 39 | # This is useful in case of remounting ext4 userdata into checkpointing mode, |
| 40 | # since it potentially requires tearing down dm-devices (e.g. dm-bow, dm-crypto) |
| 41 | # that userdata is mounted onto. |
| 42 | allow init sysfs_dm:file read; |
| 43 | |
Bart Van Assche | 9059e21 | 2021-07-29 14:53:51 -0700 | [diff] [blame] | 44 | # Allow init to modify the properties of loop devices. |
| 45 | allow init sysfs_loop:dir r_dir_perms; |
| 46 | allow init sysfs_loop:file rw_file_perms; |
| 47 | |
Bart Van Assche | 60b7d9a | 2021-10-13 16:21:54 +0000 | [diff] [blame] | 48 | # Allow init to examine the properties of block devices. |
Bart Van Assche | 398b0af | 2021-10-13 10:56:57 -0700 | [diff] [blame] | 49 | allow init sysfs_type:file { getattr read }; |
| 50 | # Allow init get the attributes of block devices in /dev/block. |
| 51 | allow init dev_type:dir r_dir_perms; |
| 52 | allow init dev_type:blk_file getattr; |
Bart Van Assche | 60b7d9a | 2021-10-13 16:21:54 +0000 | [diff] [blame] | 53 | |
Michael Rosenfeld | 3ccbebb | 2021-02-10 18:45:35 -0800 | [diff] [blame] | 54 | # Allow init to write to the drop_caches file. |
| 55 | allow init proc_drop_caches:file rw_file_perms; |
| 56 | |
Branden Archer | d36b1d5 | 2018-11-27 15:47:12 -0800 | [diff] [blame] | 57 | # Allow the BoringSSL self test to request a reboot upon failure |
| 58 | set_prop(init, powerctl_prop) |
Nikita Ioffe | 7065e46 | 2019-11-14 12:59:15 +0000 | [diff] [blame] | 59 | |
Nikita Ioffe | 7065e46 | 2019-11-14 12:59:15 +0000 | [diff] [blame] | 60 | set_prop(init, userspace_reboot_exported_prop) |
Ryan Savitski | 52b3d31 | 2020-01-14 18:20:06 +0000 | [diff] [blame] | 61 | |
| 62 | # Second-stage init performs a test for whether the kernel has SELinux hooks |
| 63 | # for the perf_event_open() syscall. This is done by testing for the syscall |
| 64 | # outcomes corresponding to this policy. |
| 65 | # TODO(b/137092007): this can be removed once the platform stops supporting |
| 66 | # kernels that precede the perf_event_open hooks (Android common kernels 4.4 |
| 67 | # and 4.9). |
| 68 | allow init self:perf_event { open cpu }; |
Alistair Delva | 178f0ac | 2020-06-05 10:15:30 -0700 | [diff] [blame] | 69 | allow init self:global_capability2_class_set perfmon; |
Ryan Savitski | 52b3d31 | 2020-01-14 18:20:06 +0000 | [diff] [blame] | 70 | |
Ryan Savitski | 4cd0994 | 2024-12-13 20:36:44 +0000 | [diff] [blame^] | 71 | # Allow opening /proc/kallsyms so that on boot, init can create and retain an |
| 72 | # fd with the full address visibility (which is evaluated on open and persists |
| 73 | # for the lifetime of the open file description). This fd can then be shared |
| 74 | # with other privileged processes. |
| 75 | allow init proc_kallsyms:file r_file_perms; |
| 76 | |
David Anderson | 0c0c13a | 2020-10-30 00:12:22 -0700 | [diff] [blame] | 77 | # Allow init to communicate with snapuserd to transition Virtual A/B devices |
| 78 | # from the first-stage daemon to the second-stage. |
| 79 | allow init snapuserd_socket:sock_file write; |
| 80 | allow init snapuserd:unix_stream_socket connectto; |
| 81 | # Allow for libsnapshot's use of flock() on /metadata/ota. |
| 82 | allow init ota_metadata_file:dir lock; |
| 83 | |
Jooyung Han | b62be12 | 2021-04-12 21:44:43 +0900 | [diff] [blame] | 84 | # Allow init to restore contexts of vd_device(/dev/block/vd[..]) when labeling |
| 85 | # /dev/block. |
| 86 | allow init vd_device:blk_file relabelto; |
| 87 | |
Ryan Savitski | 52b3d31 | 2020-01-14 18:20:06 +0000 | [diff] [blame] | 88 | set_prop(init, init_perf_lsm_hooks_prop) |
Inseob Kim | 212e2b6 | 2020-07-14 02:10:37 +0900 | [diff] [blame] | 89 | set_prop(init, vts_status_prop) |
Alexander Potapenko | 3d52817 | 2021-03-02 16:46:50 +0100 | [diff] [blame] | 90 | |
Kalesh Singh | f3fb64a | 2024-08-28 16:53:37 +0000 | [diff] [blame] | 91 | # Allow init to set 16kb app compatibility props |
| 92 | set_prop(init, bionic_linker_16kb_app_compat_prop) |
| 93 | |
Akilesh Kailash | dd8c090 | 2024-11-11 15:49:46 -0800 | [diff] [blame] | 94 | # Allow init to set/get prefetch boot prop to initiate record/replay |
| 95 | set_prop(init, ctl_prefetch_prop); |
Akilesh Kailash | dd8c090 | 2024-11-11 15:49:46 -0800 | [diff] [blame] | 96 | |
Alexander Potapenko | 3d52817 | 2021-03-02 16:46:50 +0100 | [diff] [blame] | 97 | # Allow accessing /sys/kernel/tracing/instances/bootreceiver to set up tracing. |
| 98 | allow init debugfs_bootreceiver_tracing:file w_file_perms; |
Andrew Walbran | a995e84 | 2021-03-29 17:19:12 +0000 | [diff] [blame] | 99 | |
Pete Bentley | e6da3b8 | 2022-09-16 15:31:39 +0100 | [diff] [blame] | 100 | # PRNG seeder daemon socket is created and listened on by init before forking. |
| 101 | allow init prng_seeder:unix_stream_socket { create bind listen }; |
| 102 | |
Kalesh Singh | fab8e1c | 2021-11-04 20:47:29 -0700 | [diff] [blame] | 103 | # Devices with kernels where CONFIG_HIST_TRIGGERS isn't enabled will |
| 104 | # attempt to write a non exisiting 'synthetic_events' file, when setting |
| 105 | # up synthetic events. This is a no-op in tracefs. |
| 106 | dontaudit init debugfs_tracing_debug:dir { write add_name }; |
| 107 | |
Andrew Walbran | a995e84 | 2021-03-29 17:19:12 +0000 | [diff] [blame] | 108 | # chown/chmod on devices. |
| 109 | allow init { |
| 110 | dev_type |
| 111 | -hw_random_device |
| 112 | -keychord_device |
Elliot Berman | ae5869a | 2023-03-22 17:31:35 -0700 | [diff] [blame] | 113 | -vm_manager_device_type |
Andrew Walbran | a995e84 | 2021-03-29 17:19:12 +0000 | [diff] [blame] | 114 | -port_device |
| 115 | }:chr_file setattr; |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 116 | |
| 117 | # /dev/__null__ node created by init. |
| 118 | allow init tmpfs:chr_file { create setattr unlink rw_file_perms }; |
| 119 | |
| 120 | # |
| 121 | # init direct restorecon calls. |
| 122 | # |
| 123 | # /dev/kmsg |
| 124 | allow init tmpfs:chr_file relabelfrom; |
| 125 | allow init kmsg_device:chr_file { getattr write relabelto }; |
| 126 | # /dev/kmsg_debug |
| 127 | userdebug_or_eng(` |
| 128 | allow init kmsg_debug_device:chr_file { open write relabelto }; |
| 129 | ') |
Inseob Kim | 0b9625d | 2024-07-31 17:42:23 +0900 | [diff] [blame] | 130 | # /mnt/vm, also permissions to mkdir / mount / chmod / chown |
| 131 | allow init vm_data_file:dir { add_name create search write getattr setattr relabelto mounton }; |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 132 | |
| 133 | # allow init to mount and unmount debugfs in debug builds |
| 134 | userdebug_or_eng(` |
| 135 | allow init debugfs:dir mounton; |
| 136 | ') |
| 137 | |
| 138 | # /dev/__properties__ |
| 139 | allow init properties_device:dir relabelto; |
| 140 | allow init properties_serial:file { write relabelto }; |
| 141 | allow init property_type:file { append create getattr map open read relabelto rename setattr unlink write }; |
| 142 | # /dev/__properties__/property_info and /dev/__properties/appcompat_override/property_info |
| 143 | allow init properties_device:file create_file_perms; |
| 144 | allow init property_info:file relabelto; |
| 145 | # /dev/event-log-tags |
| 146 | allow init device:file relabelfrom; |
| 147 | allow init runtime_event_log_tags_file:file { open write setattr relabelto create }; |
| 148 | # /dev/socket |
| 149 | allow init { device socket_device dm_user_device }:dir relabelto; |
| 150 | # allow init to establish connection and communicate with lmkd |
| 151 | unix_socket_connect(init, lmkd, lmkd) |
| 152 | # Relabel /dev nodes created in first stage init: /dev/console, /dev/null, /dev/ptmx, /dev/random |
| 153 | # and /dev/urandom |
| 154 | allow init { console_device null_device ptmx_device random_device } : chr_file relabelto; |
| 155 | # /dev/device-mapper, /dev/block(/.*)? |
| 156 | allow init tmpfs:{ chr_file blk_file } relabelfrom; |
| 157 | allow init tmpfs:blk_file getattr; |
| 158 | allow init block_device:{ dir blk_file lnk_file } relabelto; |
| 159 | allow init dm_device:{ chr_file blk_file } relabelto; |
| 160 | allow init dm_user_device:chr_file relabelto; |
| 161 | allow init kernel:fd use; |
| 162 | # restorecon for early mount device symlinks |
| 163 | allow init tmpfs:lnk_file { getattr read relabelfrom }; |
| 164 | allow init { |
| 165 | metadata_block_device |
| 166 | misc_block_device |
| 167 | recovery_block_device |
| 168 | system_block_device |
| 169 | userdata_block_device |
| 170 | }:{ blk_file lnk_file } relabelto; |
| 171 | |
| 172 | allow init dtbo_block_device:lnk_file relabelto; |
| 173 | allow init super_block_device:lnk_file relabelto; |
| 174 | |
| 175 | # Create /mnt/sdcard -> /storage/self/primary symlink. |
| 176 | allow init mnt_sdcard_file:lnk_file create; |
| 177 | |
| 178 | # setrlimit |
| 179 | allow init self:global_capability_class_set sys_resource; |
| 180 | |
| 181 | # Remove /dev/.booting and load /debug_ramdisk/* files |
| 182 | allow init tmpfs:file { getattr unlink }; |
| 183 | |
| 184 | # Access pty created for fsck. |
| 185 | allow init devpts:chr_file { read write open }; |
| 186 | |
| 187 | # Create /dev/fscklogs files. |
| 188 | allow init fscklogs:file create_file_perms; |
| 189 | |
| 190 | # Access /dev/__null__ node created prior to initial policy load. |
| 191 | allow init tmpfs:chr_file write; |
| 192 | |
| 193 | # Access /dev/console. |
| 194 | allow init console_device:chr_file rw_file_perms; |
| 195 | |
| 196 | # Access /dev/tty0. |
| 197 | allow init tty_device:chr_file rw_file_perms; |
| 198 | |
| 199 | # Call mount(2). |
| 200 | allow init self:global_capability_class_set sys_admin; |
| 201 | |
| 202 | # Call setns(2). |
| 203 | allow init self:global_capability_class_set sys_chroot; |
| 204 | |
| 205 | # Create and mount on directories in /. |
| 206 | allow init rootfs:dir create_dir_perms; |
| 207 | allow init { |
| 208 | rootfs |
| 209 | cache_file |
| 210 | cgroup |
| 211 | linkerconfig_file |
| 212 | storage_file |
| 213 | mnt_user_file |
| 214 | system_data_file |
| 215 | system_data_root_file |
| 216 | system_dlkm_file |
| 217 | system_file |
| 218 | vendor_file |
| 219 | postinstall_mnt_dir |
| 220 | mirror_data_file |
| 221 | shell_data_file |
| 222 | }:dir mounton; |
| 223 | |
| 224 | # Mount bpf fs on sys/fs/bpf |
| 225 | allow init fs_bpf:dir mounton; |
| 226 | |
| 227 | # Mount on /dev/usb-ffs/adb. |
| 228 | allow init device:dir mounton; |
| 229 | |
| 230 | # Mount tmpfs on /apex |
| 231 | allow init apex_mnt_dir:dir mounton; |
| 232 | |
| 233 | # Bind-mount on /system/apex/com.android.art |
| 234 | allow init art_apex_dir:dir mounton; |
| 235 | |
| 236 | # Create and remove symlinks in /. |
| 237 | allow init rootfs:lnk_file { create unlink }; |
| 238 | |
| 239 | # Mount debugfs on /sys/kernel/debug. |
| 240 | allow init sysfs:dir mounton; |
| 241 | |
| 242 | # Create cgroups mount points in tmpfs and mount cgroups on them. |
| 243 | allow init tmpfs:dir create_dir_perms; |
| 244 | allow init tmpfs:dir mounton; |
| 245 | allow init cgroup:dir create_dir_perms; |
| 246 | allow init cgroup:file rw_file_perms; |
| 247 | allow init cgroup_rc_file:file rw_file_perms; |
| 248 | allow init cgroup_desc_file:file r_file_perms; |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 249 | allow init vendor_cgroup_desc_file:file r_file_perms; |
| 250 | allow init cgroup_v2:dir { mounton create_dir_perms}; |
| 251 | allow init cgroup_v2:file rw_file_perms; |
| 252 | |
| 253 | # /config |
| 254 | allow init configfs:dir mounton; |
| 255 | allow init configfs:dir create_dir_perms; |
| 256 | allow init configfs:{ file lnk_file } create_file_perms; |
| 257 | |
| 258 | # /metadata |
| 259 | allow init metadata_file:dir mounton; |
| 260 | |
| 261 | # Run restorecon on /dev |
| 262 | allow init tmpfs:dir relabelfrom; |
| 263 | |
| 264 | # Create directories under /dev/cpuctl after chowning it to system. |
| 265 | allow init self:global_capability_class_set { dac_override dac_read_search }; |
| 266 | |
| 267 | # Set system clock. |
| 268 | allow init self:global_capability_class_set sys_time; |
| 269 | |
| 270 | allow init self:global_capability_class_set { sys_rawio mknod }; |
| 271 | |
| 272 | # Mounting filesystems from block devices. |
| 273 | allow init dev_type:blk_file r_file_perms; |
| 274 | allowxperm init dev_type:blk_file ioctl BLKROSET; |
| 275 | allowxperm init system_data_root_file:dir ioctl F2FS_IOC_SHUTDOWN; |
| 276 | |
| 277 | # Mounting filesystems. |
| 278 | # Only allow relabelto for types used in context= mount options, |
| 279 | # which should all be assigned the contextmount_type attribute. |
| 280 | # This can be done in device-specific policy via type or typeattribute |
| 281 | # declarations. |
| 282 | allow init { |
| 283 | fs_type |
| 284 | enforce_debugfs_restriction(`-debugfs_type') |
| 285 | }:filesystem ~relabelto; |
| 286 | |
| 287 | # Allow init to mount/unmount debugfs in non-user builds. |
| 288 | enforce_debugfs_restriction(` |
| 289 | userdebug_or_eng(`allow init debugfs_type:filesystem { mount unmount };') |
| 290 | ') |
| 291 | |
| 292 | # Allow init to mount tracefs in /sys/kernel/tracing |
| 293 | allow init debugfs_tracing_debug:filesystem mount; |
| 294 | |
| 295 | allow init unlabeled:filesystem ~relabelto; |
| 296 | allow init contextmount_type:filesystem relabelto; |
| 297 | |
| 298 | # Allow read-only access to context= mounted filesystems. |
| 299 | allow init contextmount_type:dir r_dir_perms; |
| 300 | allow init contextmount_type:notdevfile_class_set r_file_perms; |
| 301 | |
| 302 | # restorecon /adb_keys or any other rootfs files and directories to a more |
| 303 | # specific type. |
| 304 | allow init rootfs:{ dir file } relabelfrom; |
| 305 | |
| 306 | # mkdir, symlink, write, rm/rmdir, chown/chmod, restorecon/restorecon_recursive from init.rc files. |
| 307 | # chown/chmod require open+read+setattr required for open()+fchown/fchmod(). |
| 308 | # system/core/init.rc requires at least cache_file and data_file_type. |
| 309 | # init.<board>.rc files often include device-specific types, so |
| 310 | # we just allow all file types except /system files here. |
| 311 | allow init self:global_capability_class_set { chown fowner fsetid }; |
| 312 | |
| 313 | allow init { |
| 314 | file_type |
| 315 | -app_data_file |
Ellen Arteca | 27b515e | 2024-04-30 20:26:55 +0000 | [diff] [blame] | 316 | is_flag_enabled(RELEASE_UNLOCKED_STORAGE_API, ` |
| 317 | -storage_area_dir |
| 318 | -storage_area_app_dir |
| 319 | -storage_area_content_file |
| 320 | ') |
Inseob Kim | 0b9625d | 2024-07-31 17:42:23 +0900 | [diff] [blame] | 321 | -vm_data_file |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 322 | -bpffs_type |
| 323 | -exec_type |
| 324 | -misc_logd_file |
| 325 | -nativetest_data_file |
| 326 | -privapp_data_file |
| 327 | -system_app_data_file |
| 328 | -system_dlkm_file_type |
| 329 | -system_file_type |
| 330 | -vendor_file_type |
| 331 | }:dir { create search getattr open read setattr ioctl }; |
| 332 | |
| 333 | allow init { |
| 334 | file_type |
| 335 | -app_data_file |
Ellen Arteca | 27b515e | 2024-04-30 20:26:55 +0000 | [diff] [blame] | 336 | is_flag_enabled(RELEASE_UNLOCKED_STORAGE_API, ` |
| 337 | -storage_area_dir |
| 338 | -storage_area_app_dir |
| 339 | -storage_area_content_file |
| 340 | ') |
Inseob Kim | 0b9625d | 2024-07-31 17:42:23 +0900 | [diff] [blame] | 341 | -vm_data_file |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 342 | -bpffs_type |
| 343 | -credstore_data_file |
| 344 | -exec_type |
| 345 | -keystore_data_file |
| 346 | -media_userdir_file |
| 347 | -misc_logd_file |
| 348 | -nativetest_data_file |
| 349 | -privapp_data_file |
| 350 | -shell_data_file |
| 351 | -system_app_data_file |
| 352 | -system_dlkm_file_type |
| 353 | -system_file_type |
| 354 | -system_userdir_file |
| 355 | -vendor_file_type |
| 356 | -vendor_userdir_file |
| 357 | -vold_data_file |
| 358 | }:dir { write add_name remove_name rmdir relabelfrom }; |
| 359 | |
| 360 | allow init { |
| 361 | file_type |
| 362 | -apex_info_file |
| 363 | -app_data_file |
Ellen Arteca | 27b515e | 2024-04-30 20:26:55 +0000 | [diff] [blame] | 364 | is_flag_enabled(RELEASE_UNLOCKED_STORAGE_API, ` |
| 365 | -storage_area_dir |
| 366 | -storage_area_app_dir |
| 367 | -storage_area_content_file |
| 368 | ') |
Inseob Kim | 0b9625d | 2024-07-31 17:42:23 +0900 | [diff] [blame] | 369 | -vm_data_file |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 370 | -bpffs_type |
| 371 | -exec_type |
| 372 | -gsi_data_file |
| 373 | -credstore_data_file |
| 374 | -keystore_data_file |
| 375 | -misc_logd_file |
| 376 | -nativetest_data_file |
| 377 | -privapp_data_file |
| 378 | -runtime_event_log_tags_file |
| 379 | -shell_data_file |
| 380 | -system_app_data_file |
| 381 | -system_dlkm_file_type |
| 382 | -system_file_type |
| 383 | -vendor_file_type |
| 384 | -vold_data_file |
| 385 | enforce_debugfs_restriction(`-debugfs_type') |
| 386 | }:file { create getattr open read write setattr relabelfrom unlink map }; |
| 387 | |
| 388 | allow init tracefs_type:file { create_file_perms relabelfrom }; |
| 389 | |
| 390 | # Allow init to read /apex/apex-info-list.xml for preinstalled paths of APEXes to determine |
| 391 | # subcontext for action/service defined in APEXes. |
| 392 | allow init apex_info_file:file r_file_perms; |
| 393 | |
| 394 | allow init { |
| 395 | file_type |
| 396 | -app_data_file |
Ellen Arteca | 27b515e | 2024-04-30 20:26:55 +0000 | [diff] [blame] | 397 | is_flag_enabled(RELEASE_UNLOCKED_STORAGE_API, ` |
| 398 | -storage_area_dir |
| 399 | -storage_area_app_dir |
| 400 | -storage_area_content_file |
| 401 | ') |
Inseob Kim | 0b9625d | 2024-07-31 17:42:23 +0900 | [diff] [blame] | 402 | -vm_data_file |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 403 | -bpffs_type |
| 404 | -exec_type |
| 405 | -gsi_data_file |
| 406 | -credstore_data_file |
| 407 | -keystore_data_file |
| 408 | -misc_logd_file |
| 409 | -nativetest_data_file |
| 410 | -privapp_data_file |
| 411 | -shell_data_file |
| 412 | -system_app_data_file |
| 413 | -system_dlkm_file_type |
| 414 | -system_file_type |
| 415 | -vendor_file_type |
| 416 | -vold_data_file |
| 417 | }:{ sock_file fifo_file } { create getattr open read setattr relabelfrom unlink }; |
| 418 | |
| 419 | allow init { |
| 420 | file_type |
| 421 | -apex_mnt_dir |
| 422 | -app_data_file |
Ellen Arteca | 27b515e | 2024-04-30 20:26:55 +0000 | [diff] [blame] | 423 | is_flag_enabled(RELEASE_UNLOCKED_STORAGE_API, ` |
| 424 | -storage_area_dir |
| 425 | -storage_area_app_dir |
| 426 | -storage_area_content_file |
| 427 | ') |
Inseob Kim | 0b9625d | 2024-07-31 17:42:23 +0900 | [diff] [blame] | 428 | -vm_data_file |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 429 | -bpffs_type |
| 430 | -exec_type |
| 431 | -gsi_data_file |
| 432 | -credstore_data_file |
| 433 | -keystore_data_file |
| 434 | -misc_logd_file |
| 435 | -nativetest_data_file |
| 436 | -privapp_data_file |
| 437 | -shell_data_file |
| 438 | -system_app_data_file |
| 439 | -system_dlkm_file_type |
| 440 | -system_file_type |
| 441 | -vendor_file_type |
| 442 | -vold_data_file |
| 443 | }:lnk_file { create getattr setattr relabelfrom unlink }; |
| 444 | |
| 445 | allow init cache_file:lnk_file r_file_perms; |
| 446 | |
| 447 | allow init { |
| 448 | file_type |
| 449 | -bpffs_type |
| 450 | -system_dlkm_file_type |
| 451 | -system_file_type |
| 452 | -vendor_file_type |
| 453 | -exec_type |
| 454 | -app_data_file |
Ellen Arteca | 27b515e | 2024-04-30 20:26:55 +0000 | [diff] [blame] | 455 | is_flag_enabled(RELEASE_UNLOCKED_STORAGE_API, ` |
| 456 | -storage_area_dir |
| 457 | -storage_area_app_dir |
| 458 | -storage_area_content_file |
| 459 | ') |
Inseob Kim | 0b9625d | 2024-07-31 17:42:23 +0900 | [diff] [blame] | 460 | -vm_data_file |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 461 | -privapp_data_file |
| 462 | }:dir_file_class_set relabelto; |
| 463 | |
| 464 | allow init { sysfs no_debugfs_restriction(`debugfs') debugfs_tracing debugfs_tracing_debug }:{ dir file lnk_file } { getattr relabelfrom }; |
| 465 | allow init { sysfs_type no_debugfs_restriction(`debugfs_type') tracefs_type }:{ dir file lnk_file } { relabelto getattr }; |
| 466 | allow init dev_type:dir create_dir_perms; |
| 467 | allow init dev_type:lnk_file create; |
| 468 | |
| 469 | # Disable tracing by writing to /sys/kernel/debug/tracing/tracing_on |
| 470 | allow init debugfs_tracing:file w_file_perms; |
| 471 | |
| 472 | # Setup and control wifi event tracing (see wifi-events.rc) |
| 473 | allow init debugfs_tracing_instances:dir create_dir_perms; |
| 474 | allow init debugfs_tracing_instances:file w_file_perms; |
| 475 | allow init debugfs_wifi_tracing:file w_file_perms; |
Nate Jiang | 3ea355c | 2024-06-06 00:29:46 +0000 | [diff] [blame] | 476 | allow init debugfs_wifi_tracing:dir create_dir_perms; |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 477 | |
| 478 | # chown/chmod on pseudo files. |
| 479 | allow init { |
| 480 | fs_type |
| 481 | -bpffs_type |
| 482 | -contextmount_type |
| 483 | -keychord_device |
| 484 | -proc_type |
| 485 | -sdcard_type |
| 486 | -fusefs_type |
| 487 | -sysfs_type |
| 488 | -rootfs |
| 489 | enforce_debugfs_restriction(`-debugfs_type') |
| 490 | }:file { open read setattr }; |
| 491 | allow init { |
| 492 | fs_type |
| 493 | -bpffs_type |
| 494 | -contextmount_type |
| 495 | -sdcard_type |
| 496 | -fusefs_type |
| 497 | -rootfs |
| 498 | }:dir { open read setattr search }; |
| 499 | |
| 500 | allow init { |
| 501 | binder_device |
| 502 | console_device |
| 503 | devpts |
| 504 | dm_device |
| 505 | hwbinder_device |
| 506 | input_device |
| 507 | kmsg_device |
| 508 | null_device |
| 509 | owntty_device |
| 510 | pmsg_device |
| 511 | ptmx_device |
| 512 | random_device |
| 513 | tty_device |
| 514 | zero_device |
| 515 | }:chr_file { read open }; |
| 516 | |
| 517 | # Unlabeled file access for upgrades from 4.2. |
| 518 | allow init unlabeled:dir { create_dir_perms relabelfrom }; |
| 519 | allow init unlabeled:notdevfile_class_set { create_file_perms relabelfrom }; |
| 520 | |
| 521 | # Any operation that can modify the kernel ring buffer, e.g. clear |
| 522 | # or a read that consumes the messages that were read. |
| 523 | allow init kernel:system syslog_mod; |
| 524 | allow init self:global_capability2_class_set syslog; |
| 525 | |
| 526 | # init access to /proc. |
| 527 | r_dir_file(init, proc_net_type) |
| 528 | allow init proc_filesystems:file r_file_perms; |
| 529 | |
| 530 | userdebug_or_eng(` |
| 531 | # Overlayfs workdir write access check during mount to permit remount,rw |
| 532 | allow init overlayfs_file:dir { relabelfrom mounton write }; |
| 533 | allow init overlayfs_file:file { append rename }; |
| 534 | allow init overlayfs_file:chr_file unlink; |
| 535 | allow init system_block_device:blk_file { write }; |
| 536 | ') |
| 537 | |
| 538 | allow init { |
| 539 | proc # b/67049235 processes /proc/<pid>/* files are mislabeled. |
| 540 | proc_bootconfig |
| 541 | proc_cmdline |
| 542 | proc_diskstats |
| 543 | proc_kmsg # Open /proc/kmsg for logd service. |
| 544 | proc_meminfo |
| 545 | proc_stat # Read /proc/stat for bootchart. |
| 546 | proc_uptime |
| 547 | proc_version |
| 548 | }:file r_file_perms; |
| 549 | |
| 550 | allow init { |
| 551 | proc_abi |
| 552 | proc_cpu_alignment |
| 553 | proc_dirty |
| 554 | proc_hostname |
| 555 | proc_hung_task |
| 556 | proc_extra_free_kbytes |
| 557 | proc_net_type |
| 558 | proc_max_map_count |
| 559 | proc_min_free_order_shift |
| 560 | proc_overcommit_memory # /proc/sys/vm/overcommit_memory |
| 561 | proc_panic |
| 562 | proc_page_cluster |
| 563 | proc_perf |
| 564 | proc_sched |
| 565 | proc_sysrq |
| 566 | proc_watermark_boost_factor |
| 567 | }:file w_file_perms; |
| 568 | |
| 569 | allow init { |
| 570 | proc_security |
| 571 | }:file rw_file_perms; |
| 572 | |
| 573 | # init chmod/chown access to /proc files. |
| 574 | allow init { |
| 575 | proc_cmdline |
| 576 | proc_bootconfig |
| 577 | proc_kmsg |
| 578 | proc_net |
| 579 | proc_pagetypeinfo |
Bart Sears | dbca625 | 2024-08-04 23:06:24 +0000 | [diff] [blame] | 580 | proc_qtaguid_stat |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 581 | proc_slabinfo |
| 582 | proc_sysrq |
Bart Sears | dbca625 | 2024-08-04 23:06:24 +0000 | [diff] [blame] | 583 | proc_qtaguid_ctrl |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 584 | proc_vmallocinfo |
| 585 | }:file setattr; |
| 586 | |
| 587 | # init access to /sys files. |
| 588 | allow init { |
| 589 | sysfs_android_usb |
| 590 | sysfs_dm_verity |
| 591 | sysfs_leds |
| 592 | sysfs_power |
| 593 | sysfs_fs_f2fs |
| 594 | sysfs_dm |
| 595 | sysfs_lru_gen_enabled |
Kalesh Singh | 3a4c68d | 2024-04-09 16:24:48 -0700 | [diff] [blame] | 596 | sysfs_pgsize_migration |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 597 | }:file w_file_perms; |
| 598 | |
| 599 | allow init { |
| 600 | sysfs_dt_firmware_android |
| 601 | sysfs_fs_ext4_features |
| 602 | }:file r_file_perms; |
| 603 | |
| 604 | allow init { |
| 605 | sysfs_zram |
| 606 | }:file rw_file_perms; |
| 607 | |
| 608 | # allow init to create loop devices with /dev/loop-control |
| 609 | allow init loop_control_device:chr_file rw_file_perms; |
| 610 | allow init loop_device:blk_file rw_file_perms; |
| 611 | allowxperm init loop_device:blk_file ioctl { |
| 612 | LOOP_SET_FD |
| 613 | LOOP_CLR_FD |
| 614 | LOOP_CTL_GET_FREE |
| 615 | LOOP_SET_BLOCK_SIZE |
| 616 | LOOP_SET_DIRECT_IO |
| 617 | LOOP_GET_STATUS |
| 618 | LOOP_SET_STATUS64 |
| 619 | }; |
| 620 | |
| 621 | # Allow init to write to vibrator/trigger |
| 622 | allow init sysfs_vibrator:file w_file_perms; |
| 623 | |
| 624 | # init chmod/chown access to /sys files. |
| 625 | allow init { |
| 626 | sysfs_android_usb |
| 627 | sysfs_devices_system_cpu |
Rob Barnes | f0945b6 | 2024-10-30 22:24:21 +0000 | [diff] [blame] | 628 | sysfs_firmware_acpi_tables |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 629 | sysfs_ipv4 |
| 630 | sysfs_leds |
| 631 | sysfs_lowmemorykiller |
| 632 | sysfs_power |
| 633 | sysfs_vibrator |
| 634 | sysfs_wake_lock |
| 635 | sysfs_zram |
| 636 | }:file setattr; |
| 637 | |
| 638 | # Set usermodehelpers. |
| 639 | allow init { usermodehelper sysfs_usermodehelper }:file rw_file_perms; |
| 640 | |
| 641 | allow init self:global_capability_class_set net_admin; |
| 642 | |
| 643 | # Reboot. |
| 644 | allow init self:global_capability_class_set sys_boot; |
| 645 | |
| 646 | # Init will create /data/misc/logd when the property persist.logd.logpersistd is "logcatd". |
| 647 | # Init will also walk through the directory as part of a recursive restorecon. |
| 648 | allow init misc_logd_file:dir { add_name open create read getattr setattr search write }; |
| 649 | allow init misc_logd_file:file { open create getattr setattr write }; |
| 650 | |
| 651 | # Support "adb shell stop" |
| 652 | allow init self:global_capability_class_set kill; |
| 653 | allow init domain:process { getpgid sigkill signal }; |
| 654 | |
| 655 | # Init creates credstore's directory on boot, and walks through |
| 656 | # the directory as part of a recursive restorecon. |
| 657 | allow init credstore_data_file:dir { open create read getattr setattr search }; |
| 658 | allow init credstore_data_file:file { getattr }; |
| 659 | |
| 660 | # Init creates keystore's directory on boot, and walks through |
| 661 | # the directory as part of a recursive restorecon. |
| 662 | allow init keystore_data_file:dir { open create read getattr setattr search }; |
| 663 | allow init keystore_data_file:file { getattr }; |
| 664 | |
| 665 | # Init creates vold's directory on boot, and walks through |
| 666 | # the directory as part of a recursive restorecon. |
| 667 | allow init vold_data_file:dir { open create read getattr setattr search }; |
| 668 | allow init vold_data_file:file { getattr }; |
| 669 | |
| 670 | # Init creates /data/local/tmp at boot |
| 671 | allow init shell_data_file:dir { open create read getattr setattr search }; |
| 672 | allow init shell_data_file:file { getattr }; |
| 673 | |
| 674 | # Set UID, GID, and adjust capability bounding set for services. |
| 675 | allow init self:global_capability_class_set { setuid setgid setpcap }; |
| 676 | |
| 677 | # For bootchart to read the /proc/$pid/cmdline file of each process, |
| 678 | # we need to have following line to allow init to have access |
| 679 | # to different domains. |
| 680 | r_dir_file(init, domain) |
| 681 | |
| 682 | # Use setexeccon(), setfscreatecon(), and setsockcreatecon(). |
| 683 | # setexec is for services with seclabel options. |
| 684 | # setfscreate is for labeling directories and socket files. |
| 685 | # setsockcreate is for labeling local/unix domain sockets. |
| 686 | allow init self:process { setexec setfscreate setsockcreate }; |
| 687 | |
| 688 | # Get file context |
| 689 | allow init file_contexts_file:file r_file_perms; |
| 690 | |
| 691 | # sepolicy access |
| 692 | allow init sepolicy_file:file r_file_perms; |
| 693 | |
| 694 | # Perform SELinux access checks on setting properties. |
| 695 | selinux_check_access(init) |
| 696 | |
| 697 | # Ask the kernel for the new context on services to label their sockets. |
| 698 | allow init kernel:security compute_create; |
| 699 | |
| 700 | # Create sockets for the services. |
| 701 | allow init domain:unix_stream_socket { create bind setopt }; |
| 702 | allow init domain:unix_dgram_socket { create bind setopt }; |
| 703 | |
| 704 | # Create /data/property and files within it. |
| 705 | allow init property_data_file:dir create_dir_perms; |
| 706 | allow init property_data_file:file create_file_perms; |
| 707 | |
| 708 | # Set any property. |
| 709 | allow init property_type:property_service set; |
| 710 | |
| 711 | # Send an SELinux userspace denial to the kernel audit subsystem, |
| 712 | # so it can be picked up and processed by logd. These denials are |
| 713 | # generated when an attempt to set a property is denied by policy. |
Bo Hu | c2449d3 | 2024-12-01 21:14:32 +0000 | [diff] [blame] | 714 | allow init self:netlink_audit_socket { create_socket_perms_no_ioctl nlmsg_relay }; |
Inseob Kim | 75806ef | 2024-03-27 17:18:41 +0900 | [diff] [blame] | 715 | allow init self:global_capability_class_set audit_write; |
| 716 | |
| 717 | # Run "ifup lo" to bring up the localhost interface |
| 718 | allow init self:udp_socket { create ioctl }; |
| 719 | # in addition to unpriv ioctls granted to all domains, init also needs: |
| 720 | allowxperm init self:udp_socket ioctl SIOCSIFFLAGS; |
| 721 | allow init self:global_capability_class_set net_raw; |
| 722 | |
| 723 | # Set scheduling info for psi monitor thread. |
| 724 | # TODO: delete or revise this line b/131761776 |
| 725 | allow init kernel:process { getsched setsched }; |
| 726 | |
| 727 | # swapon() needs write access to swap device |
| 728 | # system/core/fs_mgr/fs_mgr.c - fs_mgr_swapon_all |
| 729 | allow init swap_block_device:blk_file rw_file_perms; |
| 730 | |
| 731 | # Create and access /dev files without a specific type, |
| 732 | # e.g. /dev/.coldboot_done, /dev/.booting |
| 733 | # TODO: Move these files into their own type unless they are |
| 734 | # only ever accessed by init. |
| 735 | allow init device:file create_file_perms; |
| 736 | |
| 737 | # keychord retrieval from /dev/input/ devices |
| 738 | allow init input_device:dir r_dir_perms; |
| 739 | allow init input_device:chr_file rw_file_perms; |
| 740 | |
| 741 | # Access device mapper for setting up dm-verity |
| 742 | allow init dm_device:chr_file rw_file_perms; |
| 743 | allow init dm_device:blk_file rw_file_perms; |
| 744 | |
| 745 | # Access dm-user for OTA boot |
| 746 | allow init dm_user_device:chr_file rw_file_perms; |
| 747 | |
| 748 | # Access metadata block device for storing dm-verity state |
| 749 | allow init metadata_block_device:blk_file rw_file_perms; |
| 750 | |
| 751 | # Read /sys/fs/pstore/console-ramoops to detect restarts caused |
| 752 | # by dm-verity detecting corrupted blocks |
| 753 | allow init pstorefs:dir search; |
| 754 | allow init pstorefs:file r_file_perms; |
| 755 | allow init kernel:system syslog_read; |
| 756 | |
| 757 | # linux keyring configuration |
| 758 | allow init init:key { write search setattr }; |
| 759 | |
| 760 | # Allow init to create /data/unencrypted |
| 761 | allow init unencrypted_data_file:dir create_dir_perms; |
| 762 | |
| 763 | # Set encryption policy on dirs in /data |
| 764 | allowxperm init { data_file_type unlabeled }:dir ioctl { |
| 765 | FS_IOC_GET_ENCRYPTION_POLICY |
| 766 | FS_IOC_SET_ENCRYPTION_POLICY |
| 767 | }; |
| 768 | |
| 769 | # Raw writes to misc block device |
| 770 | allow init misc_block_device:blk_file w_file_perms; |
| 771 | |
| 772 | r_dir_file(init, system_file) |
| 773 | r_dir_file(init, system_dlkm_file_type) |
| 774 | r_dir_file(init, vendor_file_type) |
| 775 | |
| 776 | allow init system_data_file:file { getattr read }; |
| 777 | allow init system_data_file:lnk_file r_file_perms; |
| 778 | |
| 779 | # For init to be able to run shell scripts from vendor |
| 780 | allow init vendor_shell_exec:file execute; |
| 781 | |
| 782 | # Metadata setup |
| 783 | allow init vold_metadata_file:dir create_dir_perms; |
| 784 | allow init vold_metadata_file:file getattr; |
| 785 | allow init metadata_bootstat_file:dir create_dir_perms; |
| 786 | allow init metadata_bootstat_file:file w_file_perms; |
| 787 | allow init userspace_reboot_metadata_file:file w_file_perms; |
| 788 | |
| 789 | # Allow init to touch PSI monitors |
| 790 | allow init proc_pressure_mem:file { rw_file_perms setattr }; |
| 791 | |
| 792 | # init is using bootstrap bionic |
| 793 | use_bootstrap_libs(init) |
| 794 | |
| 795 | # stat the root dir of fuse filesystems (for the mount handler) |
| 796 | allow init fuse:dir { search getattr }; |
| 797 | |
| 798 | # allow filesystem tuning |
| 799 | allow init userdata_sysdev:file create_file_perms; |
| 800 | |
| 801 | # allow disk tuning |
| 802 | allow init rootdisk_sysdev:file create_file_perms; |
| 803 | |
| 804 | ### |
| 805 | ### neverallow rules |
| 806 | ### |
| 807 | |
| 808 | # The init domain is only entered via an exec based transition from the |
| 809 | # kernel domain, never via setcon(). |
| 810 | neverallow domain init:process dyntransition; |
| 811 | neverallow { domain -kernel } init:process transition; |
| 812 | neverallow init { file_type fs_type -init_exec }:file entrypoint; |
| 813 | |
| 814 | # Never read/follow symlinks created by shell or untrusted apps. |
| 815 | neverallow init shell_data_file:lnk_file read; |
| 816 | neverallow init app_data_file_type:lnk_file read; |
| 817 | |
| 818 | # init should never execute a program without changing to another domain. |
| 819 | neverallow init { file_type fs_type }:file execute_no_trans; |
| 820 | |
| 821 | # The use of sensitive environment variables, such as LD_PRELOAD, is disallowed |
| 822 | # when init is executing other binaries. The use of LD_PRELOAD for init spawned |
| 823 | # services is generally considered a no-no, as it injects libraries which the |
| 824 | # binary was not expecting. This is especially problematic for APEXes. The use |
| 825 | # of LD_PRELOAD via APEXes is a layering violation, and inappropriately loads |
| 826 | # code into a process which wasn't expecting that code, with potentially |
| 827 | # unexpected side effects. (b/140789528) |
| 828 | neverallow init *:process noatsecure; |
| 829 | |
| 830 | # init can never add binder services |
| 831 | neverallow init service_manager_type:service_manager { add find }; |
| 832 | # init can never list binder services |
| 833 | neverallow init servicemanager:service_manager list; |
| 834 | |
| 835 | # Init should not be creating subdirectories in /data/local/tmp |
| 836 | neverallow init shell_data_file:dir { write add_name remove_name }; |
| 837 | |
| 838 | # Init should not access sysfs node that are not explicitly labeled. |
| 839 | neverallow init sysfs:file { open write }; |
| 840 | |
| 841 | # No domain should be allowed to ptrace init. |
| 842 | neverallow * init:process ptrace; |
| 843 | |
| 844 | # init owns the root of /data |
| 845 | # TODO(b/140259336) We want to remove vendor_init |
| 846 | # TODO(b/141108496) We want to remove toolbox |
| 847 | neverallow { domain -init -toolbox -vendor_init -vold } system_data_root_file:dir { write add_name remove_name }; |
| 848 | |
| 849 | # Only init is allowed to set userspace reboot related properties. |
| 850 | neverallow { domain -init } userspace_reboot_exported_prop:property_service set; |
| 851 | |
| 852 | neverallow init self:perf_event { kernel tracepoint read write }; |
| 853 | dontaudit init self:perf_event { kernel tracepoint read write }; |
| 854 | |
| 855 | # Only init is allowed to set the sysprop indicating whether perf_event_open() |
| 856 | # SELinux hooks were detected. |
| 857 | neverallow { domain -init } init_perf_lsm_hooks_prop:property_service set; |
| 858 | |
| 859 | # Only init can write vts.native_server.on |
| 860 | neverallow { domain -init } vts_status_prop:property_service set; |
| 861 | |
| 862 | # Only init can write normal ro.boot. properties |
| 863 | neverallow { domain -init } bootloader_prop:property_service set; |
| 864 | |
| 865 | # Only init can write hal.instrumentation.enable |
| 866 | neverallow { domain -init } hal_instrumentation_prop:property_service set; |
| 867 | |
| 868 | # Only init can write ro.property_service.version |
| 869 | neverallow { domain -init } property_service_version_prop:property_service set; |
| 870 | |
| 871 | # Only init can set keystore.boot_level |
| 872 | neverallow { domain -init } keystore_listen_prop:property_service set; |