From 7fb5a8c6cb5eb333c3683c9a4359aeb4fccc0bff Mon Sep 17 00:00:00 2001 From: "Kevin F. Haggerty" Date: Fri, 30 Nov 2018 14:14:59 -0700 Subject: [PATCH] msm8974-common: sepolicy: Label sysfs_usb_storage_gadget, resolve denials * avc: denied { setattr } for name="file" dev="sysfs" ino=23591 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_usb_storage_gadget:s0 tclass=file permissive=1 Change-Id: Ia96e3634cbe1a85bb7da3f24ecfa3fbaaa55baad --- sepolicy/common/file.te | 1 + sepolicy/common/file_contexts | 1 + sepolicy/common/init.te | 1 + 3 files changed, 3 insertions(+) diff --git a/sepolicy/common/file.te b/sepolicy/common/file.te index 5617fd4..b37830a 100644 --- a/sepolicy/common/file.te +++ b/sepolicy/common/file.te @@ -16,6 +16,7 @@ type sysfs_sec_thermistor, fs_type, sysfs_type; type sysfs_sec_touchkey, fs_type, sysfs_type; type sysfs_sec_tsp, fs_type, sysfs_type; type sysfs_usb_otg, fs_type, sysfs_type; +type sysfs_usb_storage_gadget, fs_type, sysfs_type; type sysfs_wifi_writeable, fs_type, sysfs_type; type bt_fw_file, file_type; diff --git a/sepolicy/common/file_contexts b/sepolicy/common/file_contexts index 5ec1a41..90b896b 100644 --- a/sepolicy/common/file_contexts +++ b/sepolicy/common/file_contexts @@ -91,4 +91,5 @@ /sys/devices/virtual/sensors(/.*)? u:object_r:sysfs_sensors:s0 # sysfs - usb +/sys/devices/msm_dwc3/[a-f0-9]+\.dwc3/gadget/lun[0-9]+(/.*)? u:object_r:sysfs_usb_storage_gadget:s0 /sys/devices/virtual/host_notify/usb_otg(/.*)? u:object_r:sysfs_usb_otg:s0 diff --git a/sepolicy/common/init.te b/sepolicy/common/init.te index c39cf95..b5b4a6e 100644 --- a/sepolicy/common/init.te +++ b/sepolicy/common/init.te @@ -30,6 +30,7 @@ allow init { sysfs_sensors sysfs_socinfo sysfs_usb_otg + sysfs_usb_storage_gadget }:file setattr; allow init {