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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DF514158020 for ; Wed, 12 Oct 2022 13:35:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 83760E0964; Wed, 12 Oct 2022 13:35:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 68DC1E0964 for ; Wed, 12 Oct 2022 13:35:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 815BE3410B9 for ; Wed, 12 Oct 2022 13:35:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F3051620 for ; Wed, 12 Oct 2022 13:34:58 +0000 (UTC) From: "Kenton Groombridge" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kenton Groombridge" Message-ID: <1662232070.d63d91588adf55e6867440af9b9f6a4fe6c166f6.concord@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:concord-dev commit in: policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/system/init.te policy/modules/system/systemd.if X-VCS-Directories: policy/modules/system/ X-VCS-Committer: concord X-VCS-Committer-Name: Kenton Groombridge X-VCS-Revision: d63d91588adf55e6867440af9b9f6a4fe6c166f6 X-VCS-Branch: concord-dev Date: Wed, 12 Oct 2022 13:34:58 +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: a522c691-ea49-4a98-938c-5315cedb1d47 X-Archives-Hash: 32e7bd335f8a0d7d6af05644b45e47f7 commit: d63d91588adf55e6867440af9b9f6a4fe6c166f6 Author: Dave Sugar gmail com> AuthorDate: Fri Aug 26 02:45:24 2022 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Sat Sep 3 19:07:50 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=d63d9158 systemd: init_t creates systemd-logind 'linger' directory node=localhost type=AVC msg=audit(1661480051.880:321): avc: denied { create } for pid=1027 comm="(d-logind)" name="linger" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_logind_var_lib_t:s0 tclass=dir permissive=0 Signed-off-by: Dave Sugar gmail.com> Signed-off-by: Jason Zaman gentoo.org> policy/modules/system/init.te | 1 + policy/modules/system/systemd.if | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te index 285ee5b4..9ecaae54 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te @@ -551,6 +551,7 @@ ifdef(`init_systemd',` optional_policy(` systemd_dbus_chat_logind(init_t) + systemd_create_logind_linger_dir(init_t) systemd_search_all_user_keys(init_t) systemd_create_all_user_keys(init_t) systemd_write_all_user_keys(init_t) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index f48cc541..2370c729 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -2031,6 +2031,27 @@ interface(`systemd_read_logind_state',` allow systemd_logind_t $1:file read_file_perms; ') +######################################## +## +## Allow the specified domain to create +## the systemd-logind linger directory with +## the correct context. +## +## +## +## Domain allowed access. +## +## +# +interface(`systemd_create_logind_linger_dir',` + gen_require(` + type systemd_logind_var_lib_t; + ') + + init_var_lib_filetrans($1, systemd_logind_var_lib_t, dir, "linger") + allow $1 systemd_logind_var_lib_t:dir create; +') + ######################################## ## ## Allow the specified domain to start systemd