From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 6AB105A026F for ; Wed, 16 Aug 2023 11:04:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692176647; 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: in-reply-to:in-reply-to:references:references; bh=ql8d0KAOSoiH7pBf52v0fC7vgsjzFJfo+t3pICeJI8I=; b=RH+ifHVxu49NvHz+gJeWnO3Wf8bgc3zlTCu6QD9ET+tlnichSOAb+vRnc1Pc0iBC6bMU/q aYBWrkgi4IZCVvFgrd/TXUdKYeIR7XwcVbpB6yDaHqhrmn1Z1LFOjuJvkaK4AH4cizgqGc U0xHafrVRR7cJDlQDZjBi3mH/WCfa5g= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-426-FVYv_SwXNESND4uOl1B1CA-1; Wed, 16 Aug 2023 05:04:06 -0400 X-MC-Unique: FVYv_SwXNESND4uOl1B1CA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A53FC2806067; Wed, 16 Aug 2023 09:04:05 +0000 (UTC) Received: from localhost (unknown [10.42.28.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C34A2026D4B; Wed, 16 Aug 2023 09:04:05 +0000 (UTC) Date: Wed, 16 Aug 2023 10:04:04 +0100 From: "Richard W.M. Jones" To: Stefano Brivio Subject: Re: [PATCH 2/7] selinux: Use explicit paths for binaries in file context Message-ID: <20230816090404.GB7636@redhat.com> References: <20230816060038.870746-1-sbrivio@redhat.com> <20230816060038.870746-3-sbrivio@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230816060038.870746-3-sbrivio@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Message-ID-Hash: A5Q3BMX3U3BWUPNKXYRXVVT2FRQRPQU2 X-Message-ID-Hash: A5Q3BMX3U3BWUPNKXYRXVVT2FRQRPQU2 X-MailFrom: rjones@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: passt-dev@passt.top, David Gibson 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: On Wed, Aug 16, 2023 at 08:00:33AM +0200, Stefano Brivio wrote: > There's no reason to use wildcards, and we don't want any > similarly-named binary (not that I'm aware of any) to risk being > associated to passt_exec_t and pasta_exec_t by accident. > > Signed-off-by: Stefano Brivio > --- > contrib/selinux/passt.fc | 3 ++- > contrib/selinux/pasta.fc | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/contrib/selinux/passt.fc b/contrib/selinux/passt.fc > index fb5b5d4..09bcaab 100644 > --- a/contrib/selinux/passt.fc > +++ b/contrib/selinux/passt.fc > @@ -8,5 +8,6 @@ > # Copyright (c) 2022 Red Hat GmbH > # Author: Stefano Brivio > > -/usr/bin/passt(\.*)? system_u:object_r:passt_exec_t:s0 > +/usr/bin/passt system_u:object_r:passt_exec_t:s0 > +/usr/bin/passt.avx2 system_u:object_r:passt_exec_t:s0 > /tmp/passt\.pcap system_u:object_r:passt_log_t:s0 > diff --git a/contrib/selinux/pasta.fc b/contrib/selinux/pasta.fc > index 2ffb41a..41ee46d 100644 > --- a/contrib/selinux/pasta.fc > +++ b/contrib/selinux/pasta.fc > @@ -8,6 +8,7 @@ > # Copyright (c) 2022 Red Hat GmbH > # Author: Stefano Brivio > > -/usr/bin/pasta(\.*)? system_u:object_r:pasta_exec_t:s0 > +/usr/bin/pasta system_u:object_r:pasta_exec_t:s0 > +/usr/bin/pasta.avx2 system_u:object_r:pasta_exec_t:s0 > /tmp/pasta\.pcap system_u:object_r:pasta_log_t:s0 > /var/run/pasta\.pid system_u:object_r:pasta_pid_t:s0 Obviously better, so: Reviewed-by: Richard W.M. Jones -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v