From 9d99d1d598540fea02906038cf9f7bb656b8a5b2 Mon Sep 17 00:00:00 2001 From: Randall Huang Date: Thu, 5 Sep 2024 12:01:47 +0800 Subject: [PATCH] storage: fix PowerStats avc denied avc: denied { search } for name="ufs_stats" dev="sysfs" ino=99872 scontext=u:r:hal_power_stats_default:s0 tcontext=u:object_r:sysfs_scsi_devices_0000:s0 tclass=dir permissive=1 avc: denied { open } for comm="android.hardwar" path="/sys/devices/platform/3c400000.ufs/host0/target000/0000/block/sda/stat" dev="sysfs" ino=100761 scontext=urhal_health_default avc: denied { getattr } for comm="android.hardwar" path="/sys/devices/platform/3c400000.ufs/host0/target000/0000/block/sda/stat" dev="sysfs" ino=100761 scontext=urhal_health_default avc: denied { search } for comm="android.hardwar" name="0000" dev="sysfs" ino=100578 scontext=urhal_health_defaults0 tcontext=uobject_r avc: denied { read } for comm="android.hardwar" name="stat" dev="sysfs" ino=100761 scontext=urhal_health_defaults0 tcontext=uobject_rsysfs_scsi_devices_0000s0 tclass=file permissive=1 avc: denied { search } for comm="android.hardwar" name="0000" dev="sysfs" ino=100578 scontext=urhal_health_defaults0 tcontext=uobject_r avc: denied { read } for comm="android.hardwar" name="stat" dev="sysfs" ino=100761 scontext=urhal_health_defaults0 tcontext=uobject_rsysfs_scsi_devices_0000s0 tclass=file permissive=1 Bug: 361093041 Test: dumpsys android.hardware.power.stats.IPowerStats/default Change-Id: I94dadb9b9fc015fd1ecc39f9d62bc7209375a13a Signed-off-by: Randall Huang --- storage/sepolicy/hal_health_default.te | 2 ++ storage/sepolicy/hal_power_stats_default.te | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 storage/sepolicy/hal_health_default.te create mode 100644 storage/sepolicy/hal_power_stats_default.te diff --git a/storage/sepolicy/hal_health_default.te b/storage/sepolicy/hal_health_default.te new file mode 100644 index 0000000..58ec649 --- /dev/null +++ b/storage/sepolicy/hal_health_default.te @@ -0,0 +1,2 @@ +# dumpsys android.hardware.power.stats.IPowerStats/default +r_dir_file(hal_health_default, sysfs_scsi_devices_0000) diff --git a/storage/sepolicy/hal_power_stats_default.te b/storage/sepolicy/hal_power_stats_default.te new file mode 100644 index 0000000..4d4dda7 --- /dev/null +++ b/storage/sepolicy/hal_power_stats_default.te @@ -0,0 +1,2 @@ +# dumpsys android.hardware.power.stats.IPowerStats/default +r_dir_file(hal_power_stats_default, sysfs_scsi_devices_0000)