Allow system server to access zram sysfs

This patch allows
 - System server needs write access to zram sysfs
   directory to be able to trigger writeback to disk.
 - init should be able to change attrs on zram to make
   them writeable by system_server.
 - Vendor init scripts should be able to set zram properties.

Bug: 117682284
Bug: 122674343
Test: Test writeback on go ref device
Change-Id: I308e48210f34894204992043eced5f276d736baf
This commit is contained in:
Srinivas Paladugu 2019-01-09 11:24:26 -08:00
parent 87150603f7
commit d36d94a551
3 changed files with 5 additions and 1 deletions

View file

@ -661,7 +661,7 @@ allow system_server pstorefs:file r_file_perms;
# /sys access
allow system_server sysfs_zram:dir search;
allow system_server sysfs_zram:file r_file_perms;
allow system_server sysfs_zram:file rw_file_perms;
add_service(system_server, system_server_service);
allow system_server audioserver_service:service_manager find;

View file

@ -375,6 +375,7 @@ allow init {
sysfs_power
sysfs_vibrator
sysfs_wake_lock
sysfs_zram
}:file setattr;
# Set usermodehelpers.

View file

@ -138,6 +138,9 @@ ro.telephony.iwlan_operation_mode u:object_r:exported3_default_prop:s0 exact int
ro.url.legal u:object_r:exported3_default_prop:s0 exact string
ro.url.legal.android_privacy u:object_r:exported3_default_prop:s0 exact string
ro.vendor.build.security_patch u:object_r:vendor_security_patch_level_prop:s0 exact string
ro.zram.mark_idle_delay_mins u:object_r:exported3_default_prop:s0 exact int
ro.zram.first_wb_delay_mins u:object_r:exported3_default_prop:s0 exact int
ro.zram.periodic_wb_delay_hours u:object_r:exported3_default_prop:s0 exact int
ro.zygote u:object_r:exported3_default_prop:s0 exact string
sendbug.preferred.domain u:object_r:exported3_default_prop:s0 exact string
sys.usb.controller u:object_r:exported2_system_prop:s0 exact string