Add udc sysfs to udc_sysfs fs context

Meeded for system server to monitor usb gadget state.
Grant hal_usb_impl read access as it's needed by UsbDataSessionMonitor.
Starting at board level api 202504 due to its dependency on aosp/3337514

10956 10956 W android.hardwar: type=1400 audit(0.0:327): avc:  denied  { read } for  name="state" dev="sysfs" ino=84394 scontext=u:r:hal_usb_impl:s0 tcontext=u:object_r:sysfs_udc:s0 tclass=file permissive=0

Bug: 339241080
Test: tested on Oriole
Flag: android.hardware.usb.flags.enable_udc_sysfs_usb_state_update
Change-Id: Iac9384cc81090d71e0cda8a6ba83476af865fe33
This commit is contained in:
Roy Luo 2024-12-11 15:45:42 +00:00
parent 5f17f078a9
commit 5a75cda76d
2 changed files with 4 additions and 0 deletions

View file

@ -345,3 +345,6 @@ genfscon sysfs /devices/platform/25f40000.etm u:object_r:sysfs_devices_cs_etm
# BootControl
genfscon sysfs /kernel/boot_control/blow_ar u:object_r:sysfs_bootctl:s0
# USB
genfscon sysfs /devices/platform/11110000.usb/11110000.dwc3/udc/11110000.dwc3/state u:object_r:sysfs_udc:s0

View file

@ -30,3 +30,4 @@ get_prop(hal_usb_impl, vendor_usb_config_prop);
# For monitoring usb sysfs attributes
allow hal_usb_impl sysfs_wakeup:dir search;
allow hal_usb_impl sysfs_wakeup:file r_file_perms;
allow hal_usb_impl sysfs_udc:file r_file_perms;