summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharath Gopal <gopalb@codeaurora.org>2018-03-21 18:29:10 +0530
committerJulian Veit <claymore1298@gmail.com>2019-01-23 21:59:07 +0100
commitfac56499b187a1d3d37fc16e760cc3cf701a7d91 (patch)
treefbd580880fc19b9251a1a6cd37d89b0396504cfc
parent2316e757fd37aee0a5db73b9d1939f79d50d287a (diff)
sepolicy: Add permissions for LCD brightness control
Add rule to provide permission for the hal_light_default context to read and write the sysfs node that corresponds to LCD brightness. Add rules to provide permission for the init context to change attributes of files under the sysfs and sysfs_graphics contexts. Change-Id: If8e71b0d6baa174c80369a808d427151f178c5d6
-rw-r--r--common/hal_light_default.te28
-rw-r--r--common/init.te1
2 files changed, 29 insertions, 0 deletions
diff --git a/common/hal_light_default.te b/common/hal_light_default.te
new file mode 100644
index 0000000..727e721
--- /dev/null
+++ b/common/hal_light_default.te
@@ -0,0 +1,28 @@
+# Copyright (c) 2018, The Linux Foundation. All rights reserved.
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of The Linux Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+allow hal_light_default sysfs_graphics:file rw_file_perms;
diff --git a/common/init.te b/common/init.te
index ab6511a..7d334c0 100644
--- a/common/init.te
+++ b/common/init.te
@@ -33,6 +33,7 @@ allow init firmware_file:dir { mounton };
allow init bt_firmware_file:dir { mounton };
allow init sysfs_boot_adsp:file w_file_perms;
+allow init sysfs_graphics:file setattr;
#dontaudit non configfs usb denials
dontaudit init sysfs:dir write;