From 6a64897a4b098e834f7b6679c0c5b85fdbb752b2 Mon Sep 17 00:00:00 2001
From: William Roberts <w.roberts@sta.samsung.com>
Date: Fri, 18 Jan 2013 12:18:09 -0800
Subject: [PATCH] Do not allow access to device:chr_file for system

Also labels /dev/mpu and /dev/mpuirq as gps device.
mpu is motion processing unit and is resposible for
gyroscope functionality.

Change-Id: If7f1a5752c550b72fac681566e1052f09e139ff0
---
 file_contexts | 2 ++
 system.te     | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/file_contexts b/file_contexts
index b2d253ab9..3b207c9f0 100644
--- a/file_contexts
+++ b/file_contexts
@@ -55,6 +55,8 @@
 /dev/log(/.*)?		u:object_r:log_device:s0
 /dev/mem		u:object_r:kmem_device:s0
 /dev/modem.*		u:object_r:radio_device:s0
+/dev/mpu		u:object_r:gps_device:s0
+/dev/mpuirq		u:object_r:gps_device:s0
 /dev/mtd(/.*)?		u:object_r:mtd_device:s0
 /dev/mtd/mtd5		u:object_r:radio_device:s0
 /dev/mtd/mtd5ro		u:object_r:radio_device:s0
diff --git a/system.te b/system.te
index 3ede14a2c..192b14fbe 100644
--- a/system.te
+++ b/system.te
@@ -143,7 +143,6 @@ allow system sysfs_nfc_power_writable:file rw_file_perms;
 
 # Access devices.
 allow system device:dir r_dir_perms;
-allow system device:chr_file rw_file_perms;
 allow system device:sock_file rw_file_perms;
 allow system akm_device:chr_file rw_file_perms;
 allow system accelerometer_device:chr_file rw_file_perms;
-- 
GitLab