2017-03-23 22:27:32 +01:00
|
|
|
typeattribute otapreopt_chroot coredomain;
|
|
|
|
|
2019-01-22 18:56:05 +01:00
|
|
|
# Allow to transition to postinstall_dexopt, to run otapreopt in its own sandbox.
|
2016-07-22 22:13:11 +02:00
|
|
|
domain_auto_trans(otapreopt_chroot, postinstall_file, postinstall_dexopt)
|
2019-01-15 18:36:47 +01:00
|
|
|
|
|
|
|
# Allow otapreopt_chroot to create loop devices with /dev/loop-control.
|
|
|
|
allow otapreopt_chroot loop_control_device:chr_file rw_file_perms;
|
|
|
|
# Allow otapreopt_chroot to access loop devices.
|
|
|
|
allow otapreopt_chroot loop_device:blk_file rw_file_perms;
|
|
|
|
allowxperm otapreopt_chroot loop_device:blk_file ioctl {
|
|
|
|
LOOP_GET_STATUS64
|
|
|
|
LOOP_SET_STATUS64
|
|
|
|
LOOP_SET_FD
|
|
|
|
LOOP_SET_BLOCK_SIZE
|
|
|
|
LOOP_SET_DIRECT_IO
|
|
|
|
LOOP_CLR_FD
|
|
|
|
BLKFLSBUF
|
|
|
|
};
|
|
|
|
|
|
|
|
# Allow otapreopt_chroot to configure read-ahead of loop devices.
|
|
|
|
allow otapreopt_chroot sysfs_loop:dir r_dir_perms;
|
|
|
|
allow otapreopt_chroot sysfs_loop:file rw_file_perms;
|
|
|
|
|
|
|
|
# Allow otapreopt_chroot to mount a tmpfs filesystem in /postinstall/apex.
|
|
|
|
allow otapreopt_chroot tmpfs:filesystem mount;
|
2019-01-24 15:32:17 +01:00
|
|
|
# Allow otapreopt_chroot to restore the security context of /postinstall/apex.
|
|
|
|
allow otapreopt_chroot tmpfs:dir relabelfrom;
|
|
|
|
allow otapreopt_chroot postinstall_apex_mnt_dir:dir relabelto;
|
|
|
|
|
|
|
|
# Allow otapreopt_chroot to manipulate directory /postinstall/apex.
|
|
|
|
allow otapreopt_chroot postinstall_apex_mnt_dir:dir create_dir_perms;
|
2019-01-15 18:36:47 +01:00
|
|
|
# Allow otapreopt_chroot to mount APEX packages in /postinstall/apex.
|
2019-01-24 15:32:17 +01:00
|
|
|
allow otapreopt_chroot postinstall_apex_mnt_dir:dir mounton;
|
2019-01-21 16:01:26 +01:00
|
|
|
|
2019-01-31 19:38:14 +01:00
|
|
|
# Allow otapreopt_chroot to bind-mount Bionic artifacts from the Runtime APEX
|
|
|
|
# into /postinstall/bionic/.
|
|
|
|
allow otapreopt_chroot postinstall_file:file mounton;
|
|
|
|
# Allow otapreopt_chroot to read the /postinstall/system/bin/linker(64) symlink to
|
|
|
|
# /postinstall/bionic/bin/linker(64) when executing /postinstall/system/bin/otapreopt.
|
|
|
|
allow otapreopt_chroot postinstall_file:lnk_file read;
|
|
|
|
|
2019-01-25 13:59:47 +01:00
|
|
|
# Allow otapreopt_chroot to access /dev/block (needed to detach loop
|
|
|
|
# devices used by ext4 images from APEX packages).
|
2019-01-21 16:01:26 +01:00
|
|
|
allow otapreopt_chroot block_device:dir r_dir_perms;
|