device_google_zuma/vendor/hal_usb_gadget_impl.te
Chien Kun Niu 28cc58257f 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
2023-03-15 19:17:14 +08:00

20 lines
780 B
Text

type hal_usb_gadget_impl, domain;
hal_server_domain(hal_usb_gadget_impl, hal_usb)
hal_server_domain(hal_usb_gadget_impl, hal_usb_gadget)
type hal_usb_gadget_impl_exec, vendor_file_type, exec_type, file_type;
init_daemon_domain(hal_usb_gadget_impl)
allow hal_usb_gadget_impl configfs:dir { create rmdir };
allow hal_usb_gadget_impl functionfs:dir { watch watch_reads };
set_prop(hal_usb_gadget_impl, vendor_usb_config_prop)
# parser the number of dwc3 irq
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;