From 28cc58257fedf850a2f2cbae7cfbf796182df6ba Mon Sep 17 00:00:00 2001 From: Chien Kun Niu Date: Tue, 14 Mar 2023 17:03:50 +0800 Subject: [PATCH 1/2] usb: allow hal_usb_gadget_impl sysfs_batteryinfo permission Allow hal_usb_gadget_imple sysfs_batteryinfo r_dir_perms and rw_file_perms [ 8.237410] [ T379] type=1400 audit(1678784127.396:4): avc: denied { search } for comm="HwBinder:762_1" name="power_supply" dev="sysfs" ino=73783 scontext=u:r:hal_usb_gadget_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=dir permissive=1 [ 8.237556] [ T379] type=1400 audit(1678784127.396:5): avc: denied { read } for comm="HwBinder:762_1" name="usb_type" dev="sysfs" ino=73797 scontext=u:r:hal_usb_gadget_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=1 [ 8.237584] [ T379] type=1400 audit(1678784127.396:6): avc: denied { open } for comm="HwBinder:762_1" path="/sys/devices/platform/10cb0000.hsi2c/i2c-8/8-0025/power_supply/usb/usb_type" dev="sysfs" ino=73797 scontext=u:r:hal_usb_gadget_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=1 [ 8.237603] [ T379] type=1400 audit(1678784127.396:7): avc: denied { getattr } for comm="HwBinder:762_1" path="/sys/devices/platform/10cb0000.hsi2c/i2c-8/8-0025/power_supply/usb/usb_type" dev="sysfs" ino=73797 scontext=u:r:hal_usb_gadget_impl:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=1 Bug: 272166827 Test: Check avc denied log Change-Id: Iecbf6ff712924b60ce186b75a76cf25f3b48e72d --- vendor/hal_usb_gadget_impl.te | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor/hal_usb_gadget_impl.te b/vendor/hal_usb_gadget_impl.te index 30041467..2b1494f2 100644 --- a/vendor/hal_usb_gadget_impl.te +++ b/vendor/hal_usb_gadget_impl.te @@ -15,3 +15,6 @@ allow hal_usb_gadget_impl proc_interrupts:file r_file_perms; # change irq to other cores allow hal_usb_gadget_impl proc_irq:dir r_dir_perms; allow hal_usb_gadget_impl proc_irq:file w_file_perms; + +allow hal_usb_gadget_impl sysfs_batteryinfo:dir r_dir_perms; +allow hal_usb_gadget_impl sysfs_batteryinfo:file rw_file_perms; From 8783417f2f888cfd069a621c82d7a40bd779bd99 Mon Sep 17 00:00:00 2001 From: Chien Kun Niu Date: Wed, 15 Mar 2023 19:19:44 +0800 Subject: [PATCH 2/2] usb: remove bug number in bug_map Bug: 272166827 Test: Presubmit build Pass Change-Id: I7b641636d52995dc9c098af6e7397702f0dcf4ab --- tracking_denials/bug_map | 1 - 1 file changed, 1 deletion(-) diff --git a/tracking_denials/bug_map b/tracking_denials/bug_map index bbd0003b..e59f4080 100644 --- a/tracking_denials/bug_map +++ b/tracking_denials/bug_map @@ -21,7 +21,6 @@ hal_secure_element_uicc hal_secure_element_hwservice hwservice_manager b/2644831 hal_secure_element_uicc hidl_base_hwservice hwservice_manager b/264483151 hal_thermal_default sysfs file b/272166722 hal_thermal_default sysfs file b/272166987 -hal_usb_gadget_impl sysfs_batteryinfo dir b/272166827 hal_uwb_default debugfs file b/273639365 incidentd apex_art_data_file file b/272628762 kernel vendor_fw_file dir b/272166737