healthd: fix /sys denials.

Label /sys/class/power_supply/* appropriately and give healthd read
permissions to that directory.

Fixes this denial:
avc: denied { read } for pid=1386 comm="healthd" name="power_supply"
dev="sysfs" ino=2562 scontext=u:r:healthd:s0
tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0

Bug: 72437093
Test: emulator boots with no denials from healthd
Change-Id: Ie3853cb5e9167fcd70f393ff589971ad6212c580
This commit is contained in:
Tri Vo 2018-01-24 10:58:41 -08:00
parent 37cc632f81
commit 30a532a1bf
2 changed files with 6 additions and 0 deletions

View File

@ -2,3 +2,7 @@
# /sys/bus/platform/devices/ANDR0001:00/properties/android/ which is a symlink to
# /sys/devices/platform/ANDR0001:00/properties/android/
genfscon sysfs /devices/platform/ANDR0001:00/properties/android u:object_r:sysfs_dt_firmware_android:s0
# We expect /sys/class/power_supply/* and everything it links to to be labeled
# as sysfs_batteryinfo.
genfscon sysfs /devices/platform/GFSH0001:00/power_supply u:object_r:sysfs_batteryinfo:s0

View File

@ -0,0 +1,2 @@
# Allow to read /sys/class/power_supply directory
allow healthd sysfs:dir r_dir_perms;