790f4c7e20
Address the "granted" permissions observed in the logs including: tcontext=uncrypt avc: granted { search } for comm="uncrypt" name="/" dev="mmcblk0p40" ino=2 scontext=u:r:uncrypt:s0 tcontext=u:object_r:cache_file:s0 tclass=dir tcontext=install_recovery avc: granted { search } for comm="applypatch" name="saved.file" scontext=u:r:install_recovery:s0 tcontext=u:object_r:cache_file:s0 tclass=dir avc: granted { read } for comm="applypatch" name="saved.file" dev="mmcblk0p6" ino=14 scontext=u:r:install_recovery:s0 tcontext=u:object_r:cache_file:s0 tclass=file avc: granted { getattr } for comm="applypatch" path="/cache/saved.file" dev="mmcblk0p6" ino=14 scontext=u:r:install_recovery:s0 tcontext=u:object_r:cache_file:s0 tclass=file tcontext=update_engine avc: granted { search } for comm="update_engine" name="cache" dev="sda35" ino=1409025 scontext=u:r:update_engine:s0 tcontext=u:object_r:cache_file:s0 tclass=dir" avc: granted { read } for comm="update_engine" name="update.zip" dev="sda35" ino=1409037 scontext=u:r:update_engine:s0 tcontext=u:object_r:cache_file:s0:c512,c768 tclass=file avc: granted { read } for comm="update_engine" name="cache" dev="dm-0" ino=16 scontext=u:r:update_engine:s0 tcontext=u:object_r:cache_file:s0 tclass=lnk_file Bug: 28760354 Test: build policy. Merged-In: Ia13fe47268df904bd4f815c429a0acac961aed1e Change-Id: Ia13fe47268df904bd4f815c429a0acac961aed1e
39 lines
1.1 KiB
Text
39 lines
1.1 KiB
Text
# uncrypt
|
|
type uncrypt, domain, domain_deprecated, mlstrustedsubject;
|
|
type uncrypt_exec, exec_type, file_type;
|
|
|
|
allow uncrypt self:capability dac_override;
|
|
|
|
# Read OTA zip file from /data/data/com.google.android.gsf/app_download
|
|
r_dir_file(uncrypt, app_data_file)
|
|
|
|
userdebug_or_eng(`
|
|
# For debugging, allow /data/local/tmp access
|
|
r_dir_file(uncrypt, shell_data_file)
|
|
')
|
|
|
|
# Read /cache/recovery/command
|
|
# Read /cache/recovery/uncrypt_file
|
|
allow uncrypt cache_file:dir search;
|
|
allow uncrypt cache_recovery_file:dir rw_dir_perms;
|
|
allow uncrypt cache_recovery_file:file create_file_perms;
|
|
|
|
# Read OTA zip file at /data/ota_package/.
|
|
allow uncrypt ota_package_file:dir r_dir_perms;
|
|
allow uncrypt ota_package_file:file r_file_perms;
|
|
|
|
# Write to /dev/socket/uncrypt
|
|
unix_socket_connect(uncrypt, uncrypt, uncrypt)
|
|
|
|
# Set a property to reboot the device.
|
|
set_prop(uncrypt, powerctl_prop)
|
|
|
|
# Raw writes to block device
|
|
allow uncrypt self:capability sys_rawio;
|
|
allow uncrypt misc_block_device:blk_file w_file_perms;
|
|
allow uncrypt block_device:dir r_dir_perms;
|
|
|
|
# Access userdata block device.
|
|
allow uncrypt userdata_block_device:blk_file w_file_perms;
|
|
|
|
r_dir_file(uncrypt, rootfs)
|