summaryrefslogtreecommitdiff
path: root/sepolicy
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2016-12-15 16:21:29 -0800
committerFelipe Leme <felipeal@google.com>2017-01-09 17:47:14 -0800
commit5de636642b2352d0f43a15cddff0bfbcd37c639a (patch)
treed8b783ea7dcccadbb08b9e22381de65fc6c6fa50 /sepolicy
parentb1ff0c0a6a57cae814c6eb50f8f6d344ff614422 (diff)
downloadbullhead-5de636642b2352d0f43a15cddff0bfbcd37c639a.tar.gz
Dumpstate: convert to hidl implementation.
Bug: 31982882 Test: bug report runs on device Change-Id: Ic14a3f325c41f064eb45d7584cd286d283cb51bf
Diffstat (limited to 'sepolicy')
-rw-r--r--sepolicy/file.te30
-rw-r--r--sepolicy/file_contexts10
-rw-r--r--sepolicy/hal_dumpstate_impl.te21
3 files changed, 50 insertions, 11 deletions
diff --git a/sepolicy/file.te b/sepolicy/file.te
index 655f537..b210c17 100644
--- a/sepolicy/file.te
+++ b/sepolicy/file.te
@@ -1,7 +1,12 @@
+# Debug file types
+type debugfs_rpm, fs_type, debugfs_type;
+type debugfs_ipc, fs_type, debugfs_type;
+type debugfs_bufinfo, fs_type, debugfs_type;
+
type sysfs_power_management, fs_type, sysfs_type;
type sysfs_surfaceflinger, fs_type, sysfs_type;
-#file type for irqbalance socket
+# file type for irqbalance socket
type msm_irqbalance_socket, file_type;
# Default type for anything under /firmware
@@ -13,7 +18,7 @@ type adspd_socket, file_type;
type mpdecision_socket, file_type;
type qmuxd_socket, file_type;
-#location file types
+# location file types
type location_data_file, file_type, data_file_type;
type location_app_data_file, file_type, data_file_type;
@@ -33,7 +38,7 @@ type sysfs_devices_fingerprint, sysfs_type, file_type;
type sysfs_camera, sysfs_type, file_type;
-#type for persist partition
+# type for persist partition
type persist_file, file_type;
type persist_data_file, file_type;
type persist_drm_file, file_type;
@@ -41,34 +46,37 @@ type persist_wifi_file, file_type;
type persist_sensortool_file, file_type;
type persist_camera_file, file_type;
-#File types required by mdm-helper
+# File types required by mdm-helper
type sysfs_ssr, sysfs_type, fs_type;
type sysfs_ssr_toggle, sysfs_type, file_type;
type sysfs_hsic, sysfs_type, fs_type;
type sysfs_hsic_host_rdy, sysfs_type, file_type;
-#type for thermal-engine
+# File types required by dumpstate implementation
+type sysfs_hwmon, fs_type, sysfs_type;
+
+# type for thermal-engine
type thermal_socket, file_type;
-#type for perfd
+# type for perfd
type sysfs_performance, sysfs_type, fs_type;
-#SurfaceFlinger file type for sysfs access
+# SurfaceFlinger file type for sysfs access
type sysfs_graphics, sysfs_type, fs_type;
type sysfs_display, sysfs_type, fs_type;
# Files accessed by qcom-system-daemon
type sysfs_socinfo, fs_type, sysfs_type;
-#type for uart
+# type for uart
type sysfs_msmuart_file, sysfs_type, fs_type;
-#type for proc files
+# type for proc files
type proc_irq, fs_type;
type proc_kernel_sched, fs_type;
-#type for nanoapp_cmd
+# type for nanoapp_cmd
type sysfs_nanoapp_cmd, sysfs_type, fs_type;
-#type for devstart
+# type for devstart
type sysfs_audio, sysfs_type, fs_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 5330d2f..0f86022 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -1,3 +1,9 @@
+# Debug files
+/sys/kernel/debug/rpm_stats u:object_r:debugfs_rpm:s0
+/sys/kernel/debug/rpm_master_stats u:object_r:debugfs_rpm:s0
+/sys/kernel/debug/ipc_logging(/.*)? u:object_r:debugfs_ipc:s0
+/sys/kernel/debug/dma_buf/bufinfo u:object_r:debugfs_bufinfo:s0
+
# NFC labeling
/dev/pn548 u:object_r:nfc_device:s0
/data/nfc(/.*)? u:object_r:nfc_data_file:s0
@@ -123,11 +129,15 @@
/system/bin/lowi-server u:object_r:location_exec:s0
/vendor/bin/slim_daemon u:object_r:location_exec:s0
+/vendor/bin/hw/android\.hardware\.dumpstate@1\.0-service.bullhead u:object_r:hal_dumpstate_impl_exec:s0
+
# Sysfs files used by qmuxd
/sys/devices/virtual/smdpkt/smdcntl([0-9])+/open_timeout u:object_r:sysfs_smdcntl_open_timeout:s0
/sys/class/graphics/fb0/mdp/caps u:object_r:sysfs_graphics:s0
+/sys/class/hwmon/hwmon2/device(/.*)? u:object_r:sysfs_hwmon:s0
/sys/class/thermal(/.*)? u:object_r:sysfs_thermal:s0
+/sys/devices/soc.0/qpnp-fg-18/power_supply/bms/battery_type u:object_r:sysfs_batteryinfo:s0
/sys/devices/platform/battery_current_limit u:object_r:sysfs_thermal:s0
/sys/devices/virtual/graphics/fb([0-2])+/idle_time u:object_r:sysfs_graphics:s0
/sys/devices/virtual/graphics/fb([0-2])+/dynamic_fps u:object_r:sysfs_graphics:s0
diff --git a/sepolicy/hal_dumpstate_impl.te b/sepolicy/hal_dumpstate_impl.te
new file mode 100644
index 0000000..04f0c05
--- /dev/null
+++ b/sepolicy/hal_dumpstate_impl.te
@@ -0,0 +1,21 @@
+type hal_dumpstate_impl, domain, hal_dumpstate;
+type hal_dumpstate_impl_exec, exec_type, file_type;
+
+init_daemon_domain(hal_dumpstate_impl)
+
+# Execute dump scripts
+allow hal_dumpstate_impl shell_exec:file rx_file_perms;
+allow hal_dumpstate_impl toolbox_exec:file rx_file_perms;
+
+# Access to files for dumping
+allow hal_dumpstate_impl debugfs_rpm:file r_file_perms;
+allow hal_dumpstate_impl debugfs_ipc:dir r_dir_perms;
+allow hal_dumpstate_impl debugfs_ipc:file r_file_perms;
+allow hal_dumpstate_impl debugfs_bufinfo:file r_file_perms;
+allow hal_dumpstate_impl sysfs_batteryinfo:file r_file_perms;
+allow hal_dumpstate_impl sysfs_devices_system_cpu:dir r_dir_perms;
+allow hal_dumpstate_impl sysfs_devices_system_cpu:file r_file_perms;
+allow hal_dumpstate_impl sysfs_hwmon:file r_file_perms;
+allow hal_dumpstate_impl sysfs_thermal:dir r_dir_perms;
+allow hal_dumpstate_impl proc_interrupts:file r_file_perms;
+allow hal_dumpstate_impl pstorefs:dir r_dir_perms;