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 8671A139083 for ; Tue, 12 Dec 2017 07:59:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DBBE3E0F7D; Tue, 12 Dec 2017 07:59:14 +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 A1BFDE0F7D for ; Tue, 12 Dec 2017 07:59:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 A447F33E4AD for ; Tue, 12 Dec 2017 07:59:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 45AB7AE7F for ; Tue, 12 Dec 2017 07:59:12 +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: <1513062386.cea191481ead6fd006f9dc695f491a7651b24f56.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.if policy/modules/system/systemd.te X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: cea191481ead6fd006f9dc695f491a7651b24f56 X-VCS-Branch: master Date: Tue, 12 Dec 2017 07:59:12 +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: a2f094ca-4e92-4dea-ae9a-fca65d5c1691 X-Archives-Hash: 0aea7acc30fdc5d7e7afa2bd4338de1b commit: cea191481ead6fd006f9dc695f491a7651b24f56 Author: Laurent Bigonville bigon be> AuthorDate: Wed Dec 6 17:06:04 2017 +0000 Commit: Jason Zaman gentoo org> CommitDate: Tue Dec 12 07:06:26 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=cea19148 Add private type for systemd logind inhibit files and pipes policy/modules/system/systemd.fc | 2 +- policy/modules/system/systemd.if | 20 ++++++++++++++++++++ policy/modules/system/systemd.te | 9 ++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index 392b00b9..73da3de4 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -49,7 +49,7 @@ /run/systemd/sessions(/.*)? gen_context(system_u:object_r:systemd_sessions_var_run_t,s0) /run/systemd/transient(/.*)? gen_context(system_u:object_r:systemd_unit_t,s0) /run/systemd/users(/.*)? gen_context(system_u:object_r:systemd_logind_var_run_t,s0) -/run/systemd/inhibit(/.*)? gen_context(system_u:object_r:systemd_logind_var_run_t,s0) +/run/systemd/inhibit(/.*)? gen_context(system_u:object_r:systemd_logind_inhibit_var_run_t,s0) /run/systemd/nspawn(/.*)? gen_context(system_u:object_r:systemd_nspawn_var_run_t,s0) /run/systemd/machines(/.*)? gen_context(system_u:object_r:systemd_machined_var_run_t,s0) /run/systemd/netif(/.*)? gen_context(system_u:object_r:systemd_networkd_var_run_t,s0) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index 8f914837..d875098a 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -138,6 +138,26 @@ interface(`systemd_write_inherited_logind_sessions_pipes',` allow systemd_logind_t $1:process signal; ') +###################################### +## +## Write inherited logind inhibit pipes. +## +## +## +## Domain allowed access. +## +## +# +interface(`systemd_write_inherited_logind_inhibit_pipes',` + gen_require(` + type systemd_logind_inhibit_var_run_t; + type systemd_logind_t; + ') + + allow $1 systemd_logind_t:fd use; + allow $1 systemd_logind_inhibit_var_run_t:fifo_file write; +') + ######################################## ## ## Send and receive messages from diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index 5051b87c..9a65b8f6 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -101,6 +101,9 @@ type systemd_logind_var_run_t; files_pid_file(systemd_logind_var_run_t) init_daemon_pid_file(systemd_logind_var_run_t, dir, "systemd_logind") +type systemd_logind_inhibit_var_run_t; +files_pid_file(systemd_logind_inhibit_var_run_t) + type systemd_machined_t; type systemd_machined_exec_t; init_daemon_domain(systemd_machined_t, systemd_machined_exec_t) @@ -364,7 +367,11 @@ init_var_lib_filetrans(systemd_logind_t, systemd_logind_var_lib_t, dir) manage_fifo_files_pattern(systemd_logind_t, systemd_logind_var_run_t, systemd_logind_var_run_t) manage_files_pattern(systemd_logind_t, systemd_logind_var_run_t, systemd_logind_var_run_t) allow systemd_logind_t systemd_logind_var_run_t:dir manage_dir_perms; -init_pid_filetrans(systemd_logind_t, systemd_logind_var_run_t, dir, "inhibit") + +manage_dirs_pattern(systemd_logind_t, systemd_logind_inhibit_var_run_t, systemd_logind_inhibit_var_run_t) +manage_files_pattern(systemd_logind_t, systemd_logind_inhibit_var_run_t, systemd_logind_inhibit_var_run_t) +manage_fifo_files_pattern(systemd_logind_t, systemd_logind_inhibit_var_run_t, systemd_logind_inhibit_var_run_t) +init_pid_filetrans(systemd_logind_t, systemd_logind_inhibit_var_run_t, dir, "inhibit") allow systemd_logind_t systemd_sessions_var_run_t:dir manage_dir_perms; allow systemd_logind_t systemd_sessions_var_run_t:file manage_file_perms;