From ece8ff65562f0acb910c41deb1de22cb6afb2740 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Sun, 28 Jun 2015 19:36:07 +0100 Subject: [PATCH] selinux: sensorsd can't run in init context, give it one Change-Id: Ic95d54dfdcde32ad8171bb0369b0d96aa23ee137 --- BoardConfig.mk | 5 +++++ sepolicy/file_contexts | 2 ++ sepolicy/sensors.te | 5 +++++ sepolicy/system_server.te | 3 +++ 4 files changed, 15 insertions(+) create mode 100644 sepolicy/file_contexts create mode 100644 sepolicy/sensors.te create mode 100644 sepolicy/system_server.te diff --git a/BoardConfig.mk b/BoardConfig.mk index e764b20..8756b99 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -63,5 +63,10 @@ TARGET_OTA_ASSERT_DEVICE := crackling,vixen TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop +# SELinux +BOARD_SEPOLICY_DIRS += \ + device/wileyfox/crackling/sepolicy + + # inherit from the proprietary version -include vendor/wileyfox/crackling/BoardConfigVendor.mk diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts new file mode 100644 index 0000000..e5c8fc8 --- /dev/null +++ b/sepolicy/file_contexts @@ -0,0 +1,2 @@ +/system/bin/sensord u:object_r:sensors_exec:s0 +/data/misc/sensor(/.*)? u:object_r:sensors_data_file:s0 diff --git a/sepolicy/sensors.te b/sepolicy/sensors.te new file mode 100644 index 0000000..dd94403 --- /dev/null +++ b/sepolicy/sensors.te @@ -0,0 +1,5 @@ +allow sensors sensors_data_file:fifo_file create_file_perms; +allow sensors sysfs:file rw_file_perms; +allow sensors input_device:dir r_dir_perms; +allow sensors input_device:chr_file r_file_perms; + diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te new file mode 100644 index 0000000..18c8912 --- /dev/null +++ b/sepolicy/system_server.te @@ -0,0 +1,3 @@ +allow system_server sensors_data_file:dir r_dir_perms; +allow system_server sensors_data_file:file rw_file_perms; +allow system_server sensors_data_file:fifo_file rw_file_perms;