public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Cc: Matej Hrica <mhrica@redhat.com>
Subject: [PATCH] selinux: Allow passt to talk over unconfined_t UNIX domain socket for --fd
Date: Tue,  7 Nov 2023 13:28:50 +0100	[thread overview]
Message-ID: <20231107122850.1673680-1-sbrivio@redhat.com> (raw)

If passt is started with --fd to talk over a pre-opened UNIX domain
socket, we don't really know what label might be associated to it,
but at least for an unconfined_t socket, this bit of policy wouldn't
belong to anywhere else: enable that here.

This is rather loose, of course, but on the other hand passt will
sandbox itself into an empty filesystem, so we're not really adding
much to the attack surface except for what --fd is supposed to do.

Reported-by: Matej Hrica <mhrica@redhat.com>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2247221
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
Same with this one: I'm posting this to ease reviews, but I just
applied it as I don't actually expect reviews on SELinux rules. :)

 contrib/selinux/passt.te | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/selinux/passt.te b/contrib/selinux/passt.te
index ea768d9..401c9c3 100644
--- a/contrib/selinux/passt.te
+++ b/contrib/selinux/passt.te
@@ -124,3 +124,4 @@ allow passt_t self:icmp_socket { bind create setopt read write };
 allow passt_t user_tmp_t:dir { add_name write };
 allow passt_t user_tmp_t:file { create open };
 allow passt_t user_tmp_t:sock_file { create read write unlink };
+allow passt_t unconfined_t:unix_stream_socket { read write };
-- 
@@ -124,3 +124,4 @@ allow passt_t self:icmp_socket { bind create setopt read write };
 allow passt_t user_tmp_t:dir { add_name write };
 allow passt_t user_tmp_t:file { create open };
 allow passt_t user_tmp_t:sock_file { create read write unlink };
+allow passt_t unconfined_t:unix_stream_socket { read write };
-- 
2.39.2


                 reply	other threads:[~2023-11-07 12:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231107122850.1673680-1-sbrivio@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=mhrica@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).