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 58C5F138350 for ; Sat, 15 Feb 2020 07:33:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 07841E0940; Sat, 15 Feb 2020 07:33:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C7C82E0940 for ; Sat, 15 Feb 2020 07:33:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B72D034ED1C for ; Sat, 15 Feb 2020 07:33:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F027014E for ; Sat, 15 Feb 2020 07:33:29 +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: <1581751925.bdf027e057879dbba76e032570be27e1cc8ba4cc.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/, policy/modules/kernel/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/kernel/devices.if policy/modules/system/systemd.te X-VCS-Directories: policy/modules/kernel/ policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: bdf027e057879dbba76e032570be27e1cc8ba4cc X-VCS-Branch: master Date: Sat, 15 Feb 2020 07:33:29 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3f9d4dd5-e8fc-483a-91a9-4b2848136cf9 X-Archives-Hash: 9006501d424ce2eaec690f53c0289614 commit: bdf027e057879dbba76e032570be27e1cc8ba4cc Author: Peter Morrow linux microsoft com> AuthorDate: Wed Feb 5 15:47:47 2020 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Feb 15 07:32:05 2020 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=bdf027e0 systemd_tmpfiles_t: Allow systemd_tempfiles_t to change permissions in sysfs Rules specified in system tmpfiles.d configuration files are often used to change permissions on files in sysfs. https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html Signed-off-by: Peter Morrow linux.microsoft.com> Signed-off-by: Jason Zaman gentoo.org> policy/modules/kernel/devices.if | 20 ++++++++++++++++++++ policy/modules/system/systemd.te | 1 + 2 files changed, 21 insertions(+) diff --git a/policy/modules/kernel/devices.if b/policy/modules/kernel/devices.if index afbd6d4a..1b83ea68 100644 --- a/policy/modules/kernel/devices.if +++ b/policy/modules/kernel/devices.if @@ -4413,6 +4413,26 @@ interface(`dev_relabel_all_sysfs',` allow $1 sysfs_types:lnk_file relabel_lnk_file_perms; ') +######################################## +## +## Set the attributes of sysfs files, directories and symlinks. +## +## +## +## Domain allowed access. +## +## +# +interface(`dev_setattr_all_sysfs',` + gen_require(` + attribute sysfs_types; + ') + + allow $1 sysfs_types:dir { search_dir_perms setattr }; + allow $1 sysfs_types:file setattr; + allow $1 sysfs_types:lnk_file { read_lnk_file_perms setattr }; +') + ######################################## ## ## Read and write the TPM device. diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index 4d906e5c..7624d258 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -1112,6 +1112,7 @@ dev_manage_all_dev_nodes(systemd_tmpfiles_t) dev_read_urand(systemd_tmpfiles_t) dev_relabel_all_sysfs(systemd_tmpfiles_t) dev_read_urand(systemd_tmpfiles_t) +dev_setattr_all_sysfs(systemd_tmpfiles_t) dev_manage_all_dev_nodes(systemd_tmpfiles_t) files_create_lock_dirs(systemd_tmpfiles_t)