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 87205158083 for ; Sun, 22 Sep 2024 00:03:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D14D7E29B1; Sun, 22 Sep 2024 00:03:39 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 B7458E29B4 for ; Sun, 22 Sep 2024 00:03:39 +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 0707634317D for ; Sun, 22 Sep 2024 00:03:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 45A182805 for ; Sun, 22 Sep 2024 00:03:36 +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: <1726957709.e7f3b34929de4d35cdce3344b6b0bdf988de5b56.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.te X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: e7f3b34929de4d35cdce3344b6b0bdf988de5b56 X-VCS-Branch: master Date: Sun, 22 Sep 2024 00:03:36 +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: 79a10086-35f5-4572-b052-14ff22ee2308 X-Archives-Hash: 61230a908ac4a059207b6cd97d0cf804 commit: e7f3b34929de4d35cdce3344b6b0bdf988de5b56 Author: Yi Zhao windriver com> AuthorDate: Sun Aug 11 12:00:44 2024 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sat Sep 21 22:28:29 2024 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=e7f3b349 systemd: set context to systemd_networkd_var_lib_t for /var/lib/systemd/network Fixes: avc: denied { read } for pid=344 comm="systemd-network" path="/var/lib/systemd/network" dev="vda" ino=30708 scontext=system_u:system_r:systemd_networkd_t tcontext=system_u:object_r:init_var_lib_t tclass=dir permissive=1 avc: denied { write } for pid=344 comm="systemd-network" name="network" dev="vda" ino=30708 scontext=system_u:system_r:systemd_networkd_t tcontext=system_u:object_r:init_var_lib_t tclass=dir permissive=1 avc: denied { getattr } for pid=344 comm="systemd-network" path="/var/lib/systemd/network" dev="vda" ino=30708 scontext=system_u:system_r:systemd_networkd_t tcontext=system_u:object_r:init_var_lib_t tclass=dir permissive=1 Signed-off-by: Yi Zhao windriver.com> Signed-off-by: Jason Zaman gentoo.org> policy/modules/system/systemd.fc | 1 + policy/modules/system/systemd.te | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index fd785c14e..dc41e9971 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -89,6 +89,7 @@ HOME_DIR/\.local/share/systemd(/.*)? gen_context(system_u:object_r:systemd_data /var/lib/systemd/coredump(/.*)? gen_context(system_u:object_r:systemd_coredump_var_lib_t,s0) /var/lib/systemd/home(/.*)? gen_context(system_u:object_r:systemd_homed_var_lib_t,s0) /var/lib/systemd/linger(/.*)? gen_context(system_u:object_r:systemd_logind_var_lib_t,s0) +/var/lib/systemd/network(/.*)? gen_context(system_u:object_r:systemd_networkd_var_lib_t,s0) /var/lib/systemd/pstore(/.*)? gen_context(system_u:object_r:systemd_pstore_var_lib_t,s0) /var/lib/systemd/rfkill(/.*)? gen_context(system_u:object_r:systemd_rfkill_var_lib_t,s0) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index ff47e69f9..1ac08e7d2 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -216,6 +216,9 @@ init_mountpoint(systemd_networkd_runtime_t) type systemd_networkd_unit_t; init_unit_file(systemd_networkd_unit_t) +type systemd_networkd_var_lib_t; +files_type(systemd_networkd_var_lib_t) + type systemd_notify_t; type systemd_notify_exec_t; init_daemon_domain(systemd_notify_t, systemd_notify_exec_t) @@ -1268,6 +1271,10 @@ manage_dirs_pattern(systemd_networkd_t, systemd_networkd_runtime_t, systemd_netw manage_files_pattern(systemd_networkd_t, systemd_networkd_runtime_t, systemd_networkd_runtime_t) manage_lnk_files_pattern(systemd_networkd_t, systemd_networkd_runtime_t, systemd_networkd_runtime_t) +init_var_lib_filetrans(systemd_networkd_t, systemd_networkd_var_lib_t, dir) +manage_dirs_pattern(systemd_networkd_t, systemd_networkd_var_lib_t, systemd_networkd_var_lib_t) +manage_files_pattern(systemd_networkd_t, systemd_networkd_var_lib_t, systemd_networkd_var_lib_t) + kernel_read_system_state(systemd_networkd_t) kernel_read_kernel_sysctls(systemd_networkd_t) kernel_read_network_state(systemd_networkd_t)