From d9b8ef435294359ac6e70f9d5981ee23fa0acedb Mon Sep 17 00:00:00 2001
From: Stephen Smalley <sds@tycho.nsa.gov>
Date: Thu, 16 Jan 2014 08:47:34 -0500
Subject: [PATCH] Drop legacy device types.

powervr_device is obsoleted by the more general gpu_device.
akm_device and accelerometer_device are obsoleted by the more
general sensors_device.

We could also drop the file_contexts entries altogether and
take them to device-specific policy (in this case, they all
came from crespo, so that is obsolete for master).

Change-Id: I63cef43b0d66bc99b80b64655416cc050f443e7d
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 device.te     | 3 ---
 domain.te     | 1 -
 file_contexts | 6 +++---
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/device.te b/device.te
index 5d3ba9c00..bbbec28e3 100644
--- a/device.te
+++ b/device.te
@@ -1,7 +1,5 @@
 # Device types
 type device, dev_type, fs_type;
-type akm_device, dev_type;
-type accelerometer_device, dev_type;
 type alarm_device, dev_type, mlstrustedobject;
 type adb_device, dev_type;
 type ashmem_device, dev_type, mlstrustedobject;
@@ -27,7 +25,6 @@ type log_device, dev_type, mlstrustedobject;
 type mtd_device, dev_type;
 type mtp_device, dev_type, mlstrustedobject;
 type nfc_device, dev_type;
-type powervr_device, dev_type, mlstrustedobject;
 type ptmx_device, dev_type, mlstrustedobject;
 type qemu_device, dev_type;
 type kmsg_device, dev_type;
diff --git a/domain.te b/domain.te
index 75dbe7c3b..c8063f740 100644
--- a/domain.te
+++ b/domain.te
@@ -51,7 +51,6 @@ allow domain zero_device:chr_file r_file_perms;
 allow domain ashmem_device:chr_file rw_file_perms;
 allow domain binder_device:chr_file rw_file_perms;
 allow domain ptmx_device:chr_file rw_file_perms;
-allow domain powervr_device:chr_file rw_file_perms;
 allow domain log_device:dir search;
 allow domain log_device:chr_file rw_file_perms;
 allow domain alarm_device:chr_file r_file_perms;
diff --git a/file_contexts b/file_contexts
index 42b783fd2..d2d99490e 100644
--- a/file_contexts
+++ b/file_contexts
@@ -29,8 +29,8 @@
 # Devices
 #
 /dev(/.*)?		u:object_r:device:s0
-/dev/akm8973.*		u:object_r:akm_device:s0
-/dev/accelerometer	u:object_r:accelerometer_device:s0
+/dev/akm8973.*		u:object_r:sensors_device:s0
+/dev/accelerometer	u:object_r:sensors_device:s0
 /dev/alarm		u:object_r:alarm_device:s0
 /dev/android_adb.*	u:object_r:adb_device:s0
 /dev/ashmem		u:object_r:ashmem_device:s0
@@ -64,7 +64,7 @@
 /dev/pn544		u:object_r:nfc_device:s0
 /dev/ppp		u:object_r:ppp_device:s0
 /dev/ptmx		u:object_r:ptmx_device:s0
-/dev/pvrsrvkm		u:object_r:powervr_device:s0
+/dev/pvrsrvkm		u:object_r:gpu_device:s0
 /dev/qemu_.*		u:object_r:qemu_device:s0
 /dev/kmsg		u:object_r:kmsg_device:s0
 /dev/null		u:object_r:null_device:s0
-- 
GitLab