From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9012E139085 for ; Sun, 1 Jan 2017 16:36:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9A4ECE0E83; Sun, 1 Jan 2017 16:36:53 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 69639E0E83 for ; Sun, 1 Jan 2017 16:36:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8CBCA340F43 for ; Sun, 1 Jan 2017 16:36:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 19F9325CA for ; Sun, 1 Jan 2017 16:36:50 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1483287988.136d58b22660009b8fba0fbf2a1a160aba8d9735.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/system/systemd.fc policy/modules/system/systemd.te X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 136d58b22660009b8fba0fbf2a1a160aba8d9735 X-VCS-Branch: master Date: Sun, 1 Jan 2017 16:36:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1645ed7e-d7ea-4376-b22a-0ca73e63a2ed X-Archives-Hash: 5f60f2ab7bb4f33b8f2cec186008b105 Message-ID: <20170101163650._glJ9_8UXFvdt9AetccEnPcGwhUVZcjTiUkZxbT_D3o@z> commit: 136d58b22660009b8fba0fbf2a1a160aba8d9735 Author: Nicolas Iooss m4x org> AuthorDate: Tue Dec 27 13:44:58 2016 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sun Jan 1 16:26:28 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=136d58b2 systemd: add systemd-backlight policy The documentation page of this service describes well which access are needed (https://www.freedesktop.org/software/systemd/man/systemd-backlight .service.html). systemd-backlight: - is a systemd service - manages /var/lib/systemd/backlight/ - reads udev device properties to find ID_BACKLIGHT_CLAMP Signed-off-by: Nicolas Iooss m4x.org> policy/modules/system/systemd.fc | 2 ++ policy/modules/system/systemd.te | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index ff0f976..673bb68 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -28,7 +28,9 @@ /usr/lib/systemd/system/[^/]*shutdown.* -- gen_context(system_u:object_r:power_unit_t,s0) /usr/lib/systemd/system/[^/]*sleep.* -- gen_context(system_u:object_r:power_unit_t,s0) /usr/lib/systemd/system/[^/]*suspend.* -- gen_context(system_u:object_r:power_unit_t,s0) +/usr/lib/systemd/system/systemd-backlight.* -- gen_context(system_u:object_r:systemd_backlight_unit_t,s0) +/var/lib/systemd/backlight(/.*)? gen_context(system_u:object_r:systemd_backlight_var_lib_t,s0) /var/lib/systemd/linger(/.*)? gen_context(system_u:object_r:systemd_logind_var_lib_t,s0) /run/\.nologin[^/]* -- gen_context(system_u:object_r:systemd_sessions_var_run_t,s0) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index 196abab..c50e93a 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -26,6 +26,12 @@ type systemd_backlight_t; type systemd_backlight_exec_t; init_system_domain(systemd_backlight_t, systemd_backlight_exec_t) +type systemd_backlight_unit_t; +init_unit_file(systemd_backlight_unit_t) + +type systemd_backlight_var_lib_t; +files_type(systemd_backlight_var_lib_t) + type systemd_binfmt_t; type systemd_binfmt_exec_t; init_system_domain(systemd_binfmt_t, systemd_binfmt_exec_t) @@ -140,6 +146,24 @@ logging_send_syslog_msg(systemd_log_parse_env_type) ###################################### # +# Backlight local policy +# + +allow systemd_backlight_t systemd_backlight_var_lib_t:dir manage_dir_perms; +init_var_lib_filetrans(systemd_backlight_t, systemd_backlight_var_lib_t, dir) +manage_files_pattern(systemd_backlight_t, systemd_backlight_var_lib_t, systemd_backlight_var_lib_t) + +systemd_log_parse_environment(systemd_backlight_t) + +# Allow systemd-backlight to write to /sys/class/backlight/*/brightness +dev_rw_sysfs(systemd_backlight_t) + +files_read_etc_files(systemd_backlight_t) + +udev_read_pid_files(systemd_backlight_t) + +###################################### +# # Cgroups local policy #