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 B5E0A138350 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 0CDE8E0943; Sat, 15 Feb 2020 07:33:36 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 D646BE093D for ; Sat, 15 Feb 2020 07:33:35 +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 00A6134ED32 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 81734157 for ; Sat, 15 Feb 2020 07:33:30 +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.d372650e27df2987b357dea9a06b20972910452a.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/init.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: d372650e27df2987b357dea9a06b20972910452a X-VCS-Branch: master Date: Sat, 15 Feb 2020 07:33:30 +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: 66c36a4d-9ff4-4374-9136-4d220f036f72 X-Archives-Hash: e2201ddd3a2327f601a77af85f9c2b6e commit: d372650e27df2987b357dea9a06b20972910452a Author: bauen1 gmail com> AuthorDate: Sat Feb 8 15:16:14 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=d372650e init: split init_create_pid_files interface Signed-off-by: Jason Zaman gentoo.org> policy/modules/system/init.if | 24 +++++++++++++++++++++--- policy/modules/system/systemd.te | 3 ++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 03538310..b1b6ca2d 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -1400,7 +1400,7 @@ interface(`init_manage_pid_symlinks', ` ###################################### ## -## Create and write files in the /run/systemd directory. +## Create files in the /run/systemd directory. ## ## ## @@ -1408,12 +1408,30 @@ interface(`init_manage_pid_symlinks', ` ## ## # -interface(`init_create_write_pid_files', ` +interface(`init_create_pid_files', ` gen_require(` type init_runtime_t; ') - allow $1 init_runtime_t:file { create_file_perms write }; + allow $1 init_runtime_t:file create_file_perms; +') + +###################################### +## +## Write files in the /run/systemd directory. +## +## +## +## Domain allowed access. +## +## +# +interface(`init_write_pid_files', ` + gen_require(` + type init_runtime_t; + ') + + allow $1 init_runtime_t:file write_file_perms; ') ###################################### diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index f0412af3..3edbc98e 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -283,10 +283,11 @@ files_search_pids(systemd_fstab_generator_t) fstools_exec(systemd_fstab_generator_t) -init_create_write_pid_files(systemd_fstab_generator_t) +init_create_pid_files(systemd_fstab_generator_t) init_manage_pid_dirs(systemd_fstab_generator_t) init_manage_pid_symlinks(systemd_fstab_generator_t) init_search_pids(systemd_fstab_generator_t) +init_write_pid_files(systemd_fstab_generator_t) kernel_read_kernel_sysctls(systemd_fstab_generator_t)