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 83693139085 for ; Sun, 1 Jan 2017 16:37:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26C7DE0EB3; Sun, 1 Jan 2017 16:37:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 051F4E0EB4 for ; Sun, 1 Jan 2017 16:37:43 +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 3BC02340F53 for ; Sun, 1 Jan 2017 16:37:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4FA9D25C7 for ; Sun, 1 Jan 2017 16:37:39 +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.3225e34cc39a06b44cc0871b984791eeaf9bb970.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:next 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: 3225e34cc39a06b44cc0871b984791eeaf9bb970 X-VCS-Branch: next Date: Sun, 1 Jan 2017 16:37:39 +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: 6db6220e-91c2-4714-9d09-25b115ad8b9e X-Archives-Hash: 012a9a0dad3dc3fcedaff1fb7fcfeef9 Message-ID: <20170101163739.xV7Ldcfh4fV-pd8_xClON9snTmC5OsAaqXax-kXHgoU@z> commit: 3225e34cc39a06b44cc0871b984791eeaf9bb970 Author: Nicolas Iooss m4x org> AuthorDate: Tue Dec 27 13:45:21 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=3225e34c systemd: add systemd-binfmt policy This systemd service registers in /proc/sys/fs/binfmt_misc binary formats for executables. Signed-off-by: Nicolas Iooss m4x.org> policy/modules/system/systemd.fc | 1 + policy/modules/system/systemd.te | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index 673bb68..d66feda 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -29,6 +29,7 @@ /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) +/usr/lib/systemd/system/systemd-binfmt.* -- gen_context(system_u:object_r:systemd_binfmt_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) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index c50e93a..cf22ba8 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -36,6 +36,9 @@ type systemd_binfmt_t; type systemd_binfmt_exec_t; init_system_domain(systemd_binfmt_t, systemd_binfmt_exec_t) +type systemd_binfmt_unit_t; +init_unit_file(systemd_binfmt_unit_t) + type systemd_cgroups_t; type systemd_cgroups_exec_t; domain_type(systemd_cgroups_t) @@ -162,6 +165,18 @@ files_read_etc_files(systemd_backlight_t) udev_read_pid_files(systemd_backlight_t) +####################################### +# +# Binfmt local policy +# + +systemd_log_parse_environment(systemd_binfmt_t) + +# Allow to read /etc/binfmt.d/ files +files_read_etc_files(systemd_binfmt_t) + +fs_register_binary_executable_type(systemd_binfmt_t) + ###################################### # # Cgroups local policy