universal7580: sepolicy: correct sswap sysfs node labelling
authorDanny Wood <danwood76@gmail.com>
Fri, 29 Nov 2019 11:42:54 +0000 (11:42 +0000)
committerDanny Wood <danwood76@gmail.com>
Tue, 10 Mar 2020 15:25:57 +0000 (15:25 +0000)
Change-Id: Id3a0757941ee4ec7bf73b4d012239b94c86ab782

sepolicy/genfs_contexts
sepolicy/init.te
sepolicy/sswap.te

index 734b8eb03dc459fcee7faefd959a25fd9a7abad9..3d7ffdad43b228c8fb167057222b9bc40e8367f6 100644 (file)
@@ -63,9 +63,7 @@ genfscon sysfs /class/input_booster/head    u:object_r:sysfs_input:s0
 genfscon sysfs /class/input_booster/tail    u:object_r:sysfs_input:s0
 
 # Swap
-genfscon sysfs /devices/virtual/block/vnswap0/disksize              u:object_r:sysfs_sswap:s0
-genfscon sysfs /devices/virtual/block/vnswap0/swap_filename         u:object_r:sysfs_sswap:s0
-genfscon sysfs /devices/virtual/block/vnswap0/init_backing_storage  u:object_r:sysfs_sswap:s0
+genfscon sysfs /devices/virtual/block/vnswap0   u:object_r:sysfs_sswap:s0
 
 # CPU/Scheduler devices
 genfscon sysfs /power/cpufreq_table         u:object_r:sysfs_devices_system_cpu:s0
index 4c0d72007768138b89bc61553a6e1276847cfd3f..6a35a07cafa48e036ea6af23b460d13170753080 100644 (file)
@@ -49,6 +49,10 @@ allow init sysfs_gps:file setattr;
 # CPU permissions
 allow init sysfs_devices_system_cpu:file rw_file_perms;
 
+# sswap permissions
+allow init sswap_device:blk_file write;
+allow init sysfs_sswap:file { open write };
+
 # Block device sysfs
 allow init sysfs_block:file rw_file_perms;
 
index f5a7a70a45b9d05d09e9c0a5d670d62fd478049e..41fefb8fac5e4c81e2f516126ad2a36dddd67d48 100644 (file)
@@ -6,10 +6,10 @@ init_daemon_domain(sswap);
 
 allow sswap sswap_device:blk_file rw_file_perms;
 allow sswap sysfs_sswap:file rw_file_perms;
+allow sswap sysfs_sswap:dir search;
 allow sswap block_device:dir search;
 allow sswap self:capability sys_admin;
 
-allow sswap proc:file r_file_perms;
 allow sswap proc_meminfo:file r_file_perms;
 
 allow sswap properties_device:dir r_dir_perms;