From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GbVkhBhW; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 589605A0271 for ; Wed, 17 Sep 2025 14:05:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758110732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hO9/Bpe2B1sSQrpH+b2eOP78oyxi+tYVh1wuPiPB478=; b=GbVkhBhW2uq6+AaivWX+fqHZHHpLixI+yU8ToHSJu1rHny00FdUv3hJUsqOaa0KEXPu6x0 F1a+I803YTY4tmZh/6djrfcLDN/DX9bBhYriCO84PTMBw5wsHRn0AjgPOeDd4emw5Y1B6D Ku0VVeBQ94JFR/9p14i02TvFjIZS7nQ= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-H5OgkvHYNQ2YZSB2N1xV8g-1; Wed, 17 Sep 2025 08:05:28 -0400 X-MC-Unique: H5OgkvHYNQ2YZSB2N1xV8g-1 X-Mimecast-MFC-AGG-ID: H5OgkvHYNQ2YZSB2N1xV8g_1758110728 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DC2801956089; Wed, 17 Sep 2025 12:05:27 +0000 (UTC) Received: from pholzing-fedora.redhat.com (unknown [10.44.33.167]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 394EA19560BB; Wed, 17 Sep 2025 12:05:24 +0000 (UTC) From: Paul Holzinger To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 1/2] selinux: add container_var_run_t type transition Date: Wed, 17 Sep 2025 14:04:50 +0200 Message-ID: <20250917120450.36181-2-pholzing@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: naQXiqdMjE4e_9rpMzQDqH8X4Y-GKAtiXmIMz3ezi60_1758110728 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: Y6FBHL72K2IZVZVGFHC7YYHXUSDKIUGI X-Message-ID-Hash: Y6FBHL72K2IZVZVGFHC7YYHXUSDKIUGI X-MailFrom: pholzing@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Max Chernoff , Giuseppe Scrivano , Lokesh Mandvekar , Dan Walsh , Paul Holzinger X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In some cases the podman runroot directory used to be labelled container_var_run_t instead of user_tmp_t which was expected here. Starting with a recent container-selinux change the runroot is now always container_var_run_t so make the policy handle both types to allow for a better upgrade path where passt-selinux and container-selinux are not updated at the same time. Link: https://github.com/containers/container-selinux/pull/405 Link: https://github.com/containers/podman/issues/26473 Signed-off-by: Paul Holzinger --- contrib/selinux/pasta.te | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/selinux/pasta.te b/contrib/selinux/pasta.te index c0a1e9b..24e58c8 100644 --- a/contrib/selinux/pasta.te +++ b/contrib/selinux/pasta.te @@ -96,6 +96,7 @@ require { role staff_r; role user_r; type container_runtime_t; + type container_var_run_t; type container_t; type systemd_user_runtimedir_t; } @@ -242,8 +243,12 @@ type_transition container_runtime_t pasta_exec_t : process pasta_t; allow container_runtime_t pasta_t:process transition; # Label the user network namespace files +# Note podman files used to be user_tmp_t but now are container_var_run_t since +# https://github.com/containers/container-selinux/issues/404. type_transition container_runtime_t user_tmp_t : dir ifconfig_var_run_t "netns"; +type_transition container_runtime_t container_var_run_t : dir ifconfig_var_run_t "netns"; type_transition container_runtime_t user_tmp_t : dir ifconfig_var_run_t "rootless-netns"; +type_transition container_runtime_t container_var_run_t : dir ifconfig_var_run_t "rootless-netns"; allow pasta_t ifconfig_var_run_t:dir { add_name open rmdir write }; allow pasta_t ifconfig_var_run_t:file { create open write }; allow systemd_user_runtimedir_t ifconfig_var_run_t:dir rmdir; -- 2.51.0