From beb4f82d327e10d4f2516a2fbd7ac8dee3d9d877 Mon Sep 17 00:00:00 2001 From: Albert Wang Date: Wed, 17 Mar 2021 16:24:42 +0800 Subject: [PATCH] sepolicy: fix usb hal selinux permission avc: denied { read } for name="port0-partner" dev="sysfs" ino=98412 scontext=u:r:hal_usb_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=dir permissive=1 avc: denied { open } for path="/sys/devices/platform/10d50000.hsi2c/i2c-6/6-0025/typec/port0/port0-partner" dev="sysfs" ino=98412 scontext=u:r:hal_usb_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=dir permissive=1 avc: denied { getattr } for path="/sys/devices/platform/10d50000.hsi2c/i2c-5/5-0025/typec/port0/power_role" dev="sysfs" ino=67861 scontext=u:r:hal_usb_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=1 avc: denied { open } for path="/sys/devices/platform/10d50000.hsi2c/i2c-5/5-0025/typec/port0/power_role" dev="sysfs" ino=67861 scontext=u:r:hal_usb_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=1 avc: denied { write } for name="port_type" dev="sysfs" ino=71778 scontext=u:r:hal_usb_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=1 Bug: 182122983 Test: atest VtsHalUsbV1_0TargetTest atest HalUsbGadgetV1_0HostTest Signed-off-by: Albert Wang Change-Id: Ia2cf9061dd5eaa7af582331477afd34db56531e8 --- whitechapel/vendor/google/hal_usb_impl.te | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whitechapel/vendor/google/hal_usb_impl.te b/whitechapel/vendor/google/hal_usb_impl.te index c95035ca..6c48682a 100644 --- a/whitechapel/vendor/google/hal_usb_impl.te +++ b/whitechapel/vendor/google/hal_usb_impl.te @@ -8,5 +8,5 @@ init_daemon_domain(hal_usb_impl) allow hal_usb_impl functionfs:dir { watch watch_reads }; set_prop(hal_usb_impl, vendor_usb_config_prop) -allow hal_usb_impl sysfs_batteryinfo:dir search; -allow hal_usb_impl sysfs_batteryinfo:file r_file_perms; +allow hal_usb_impl sysfs_batteryinfo:dir r_dir_perms; +allow hal_usb_impl sysfs_batteryinfo:file rw_file_perms;