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 5D1A6138334 for ; Fri, 8 Jun 2018 10:07:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B4B05E0828; Fri, 8 Jun 2018 10:07:30 +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 530C3E0828 for ; Fri, 8 Jun 2018 10:07:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 CACF2335CB9 for ; Fri, 8 Jun 2018 10:07:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1CDBE2CF for ; Fri, 8 Jun 2018 10:07:26 +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: <1528449661.3f528d57501507ca95e24e88e0c29c36bd216bef.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.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: 3f528d57501507ca95e24e88e0c29c36bd216bef X-VCS-Branch: master Date: Fri, 8 Jun 2018 10:07:26 +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: e2edf258-8d8f-472c-bb16-5d395f3ad76f X-Archives-Hash: b6a8d8e2fa31bd72ac5d5cfe2e848376 commit: 3f528d57501507ca95e24e88e0c29c36bd216bef Author: Dave Sugar tresys com> AuthorDate: Wed Jun 6 14:25:07 2018 +0000 Commit: Jason Zaman gentoo org> CommitDate: Fri Jun 8 09:21:01 2018 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=3f528d57 Allow systemd_resolved to read systemd_networkd runtime files type=AVC msg=audit(1527698299.999:144): avc: denied { read } for pid=1193 comm="systemd-resolve" name="links" dev="tmpfs" ino=16229 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=dir type=AVC msg=audit(1527698299.999:145): avc: denied { read } for pid=1193 comm="systemd-resolve" name="3" dev="tmpfs" ino=18857 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527698299.999:145): avc: denied { open } for pid=1193 comm="systemd-resolve" path="/run/systemd/netif/links/3" dev="tmpfs" ino=18857 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527698300.000:146): avc: denied { getattr } for pid=1193 comm="systemd-resolve" path="/run/systemd/netif/links/3" dev="tmpfs" ino=18857 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527702014.276:183): avc: denied { search } for pid=1180 comm="systemd-resolve" name="netif" dev="tmpfs" ino=16878 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=dir type=AVC msg=audit(1527704163.181:152): avc: denied { open } for pid=1236 comm="systemd-resolve" path="/run/systemd/netif/links/5" dev="tmpfs" ino=19562 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527704163.181:153): avc: denied { getattr } for pid=1236 comm="systemd-resolve" path="/run/systemd/netif/links/5" dev="tmpfs" ino=19562 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file type=AVC msg=audit(1527704163.604:173): avc: denied { read } for pid=1236 comm="systemd-resolve" name="5" dev="tmpfs" ino=19562 scontext=system_u:system_r:systemd_resolved_t:s0 tcontext=system_u:object_r:systemd_networkd_var_run_t:s0 tclass=file Signed-off-by: Dave Sugar tresys.com> policy/modules/system/systemd.if | 19 +++++++++++++++++++ policy/modules/system/systemd.te | 1 + 2 files changed, 20 insertions(+) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if index 866838fe..b053242a 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -523,6 +523,25 @@ interface(`systemd_rw_networkd_netlink_route_sockets',` allow $1 systemd_networkd_t:netlink_route_socket client_stream_socket_perms; ') +####################################### +## +## Allow domain to read files generated by systemd_networkd +## +## +## +## domain allowed access +## +## +# + +interface(`systemd_read_networkd_runtime',` + gen_require(` + type systemd_networkd_var_run_t; + ') + + list_dirs_pattern($1, systemd_networkd_var_run_t, systemd_networkd_var_run_t) + read_files_pattern($1, systemd_networkd_var_run_t, systemd_networkd_var_run_t) +') ######################################## ## diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te index 708b9f23..79774dd3 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -858,6 +858,7 @@ auth_use_nsswitch(systemd_resolved_t) seutil_read_file_contexts(systemd_resolved_t) systemd_log_parse_environment(systemd_resolved_t) +systemd_read_networkd_runtime(systemd_resolved_t) optional_policy(` dbus_system_bus_client(systemd_resolved_t)