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 BD8F4158043 for ; Fri, 1 Mar 2024 19:56:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9A38AE2A14; Fri, 1 Mar 2024 19:56:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 78E36E2A14 for ; Fri, 1 Mar 2024 19:56:15 +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 6891A343118 for ; Fri, 1 Mar 2024 19:56:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2C35E14F9 for ; Fri, 1 Mar 2024 19:56:11 +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: <1709312755.9127b63127407012150cc1257dab821bc300477d.concord@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/sysnetwork.if policy/modules/system/udev.te X-VCS-Directories: policy/modules/system/ X-VCS-Committer: concord X-VCS-Committer-Name: Kenton Groombridge X-VCS-Revision: 9127b63127407012150cc1257dab821bc300477d X-VCS-Branch: master Date: Fri, 1 Mar 2024 19:56:11 +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: 13c1e386-0d19-4227-a04d-b84d932385dd X-Archives-Hash: e5b8a57fca4474f0cffb691f3c3079a9 commit: 9127b63127407012150cc1257dab821bc300477d Author: Christian Göttsche googlemail com> AuthorDate: Thu Feb 22 17:00:51 2024 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Fri Mar 1 17:05:55 2024 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=9127b631 udev: update AVC avc: denied { create } for pid=685 comm="ifquery" name="network" scontext=system_u:system_r:udev_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=dir permissive=1 Signed-off-by: Christian Göttsche googlemail.com> Signed-off-by: Kenton Groombridge gentoo.org> policy/modules/system/sysnetwork.if | 30 ++++++++++++++++++++++++++++++ policy/modules/system/udev.te | 3 +++ 2 files changed, 33 insertions(+) diff --git a/policy/modules/system/sysnetwork.if b/policy/modules/system/sysnetwork.if index f41024669..884f3735d 100644 --- a/policy/modules/system/sysnetwork.if +++ b/policy/modules/system/sysnetwork.if @@ -489,6 +489,7 @@ interface(`sysnet_create_config',` ') files_search_etc($1) + allow $1 net_conf_t:dir { add_entry_dir_perms create_dir_perms }; allow $1 net_conf_t:file create_file_perms; ') @@ -535,6 +536,35 @@ interface(`sysnet_etc_filetrans_config',` files_etc_filetrans($1, net_conf_t, file, $2) ') +####################################### +## +## Create files in /run with the type used for +## the network config files. +## +## +## +## Domain allowed access. +## +## +## +## +## The object class of the object being created. +## +## +## +## +## The name of the object being created. +## +## +# +interface(`sysnet_runtime_filetrans_config',` + gen_require(` + type net_conf_t; + ') + + files_runtime_filetrans($1, net_conf_t, $2, $3) +') + ####################################### ## ## Create, read, write, and delete network config files. diff --git a/policy/modules/system/udev.te b/policy/modules/system/udev.te index 6e24d515f..8ecc17bc7 100644 --- a/policy/modules/system/udev.te +++ b/policy/modules/system/udev.te @@ -217,6 +217,9 @@ ifdef(`distro_debian',` files_runtime_filetrans(udev_t, udev_runtime_t, dir, "xen-hotplug") + sysnet_runtime_filetrans_config(udev_t, dir, "network") + sysnet_create_config(udev_t) + optional_policy(` # for /usr/lib/avahi/avahi-daemon-check-dns.sh kernel_read_vm_sysctls(udev_t)