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 (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 24B5E1580FD for ; Sun, 15 Dec 2024 00:30:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C93AE09C8; Sun, 15 Dec 2024 00:30:19 +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 341FAE09C8 for ; Sun, 15 Dec 2024 00:30:19 +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 7B218342F9C for ; Sun, 15 Dec 2024 00:30:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B8D9E1F9A for ; Sun, 15 Dec 2024 00:30:15 +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: <1734221959.34b81b634f7a8bdc59fe7ffa6d6453a9c07d001f.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: 34b81b634f7a8bdc59fe7ffa6d6453a9c07d001f X-VCS-Branch: master Date: Sun, 15 Dec 2024 00:30:15 +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: 5c83979a-9742-4d20-bd57-d85bedf9e599 X-Archives-Hash: b8bebb25cab851b68a45e77b1b66cdb7 commit: 34b81b634f7a8bdc59fe7ffa6d6453a9c07d001f Author: Rahul Sandhu sandhuservices dev> AuthorDate: Thu Nov 28 02:56:31 2024 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sun Dec 15 00:19:19 2024 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=34b81b63 systemd_homed_runtime_work_dir_t: new type for systemd-homed workdir As systemd-homed's workdir is an internal one, and external domains may be (reasonably) expected to connect to systemd_homed_runtime_t in the future, let's create a new domain for systemd-homed's internal work to differentiate between the two. Signed-off-by: Rahul Sandhu sandhuservices.dev> Signed-off-by: Jason Zaman gentoo.org> policy/modules/system/systemd.fc | 1 + policy/modules/system/systemd.te | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc index 68fcedbe3..ce48c7d09 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -112,6 +112,7 @@ HOME_ROOT/(.+)\.home -- gen_context(system_u:object_r:systemd_homed_storage_t,s0 /run/systemd/ask-password(/.*)? gen_context(system_u:object_r:systemd_passwd_runtime_t,s0) /run/systemd/ask-password-block(/.*)? gen_context(system_u:object_r:systemd_passwd_runtime_t,s0) /run/systemd/home(/.*)? gen_context(system_u:object_r:systemd_homed_runtime_t,s0) +/run/systemd/user-home-mount -d gen_context(system_u:object_r:systemd_homed_runtime_work_dir_t,s0) /run/systemd/network(/.*)? gen_context(system_u:object_r:systemd_networkd_runtime_t,s0) /run/systemd/notify -s gen_context(system_u:object_r:systemd_runtime_notify_t,s0) /run/systemd/resolve(/.*)? gen_context(system_u:object_r:systemd_resolved_runtime_t,s0) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index dca7f098d..b8a52c7c8 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -129,6 +129,10 @@ role system_r types systemd_homework_t; type systemd_homed_runtime_t; files_runtime_file(systemd_homed_runtime_t) +type systemd_homed_runtime_work_dir_t; +files_runtime_file(systemd_homed_runtime_work_dir_t) +files_mountpoint(systemd_homed_runtime_work_dir_t) + type systemd_homed_storage_t; files_type(systemd_homed_storage_t) @@ -736,7 +740,7 @@ init_runtime_filetrans(systemd_homework_t, systemd_homed_runtime_t, dir) files_read_etc_runtime(systemd_homework_t) # mount on /run/systemd/user-home-mount -allow systemd_homework_t systemd_homed_runtime_t:dir mounton; +allow systemd_homework_t systemd_homed_runtime_work_dir_t:dir mounton; allow systemd_homework_t systemd_homed_storage_t:file manage_file_perms; files_home_filetrans(systemd_homework_t, systemd_homed_storage_t, file)