All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: selinux@vger.kernel.org
Subject: [PATCH testsuite] policy: fix testsuite_domain_type_minimal() to work with rpm-ostree
Date: Thu,  8 Feb 2024 17:11:25 +0100	[thread overview]
Message-ID: <20240208161125.620477-1-omosnace@redhat.com> (raw)

After a live package installation on an OSTree system using `rpm-ostree
install --apply-live ...`, domains need to be able to use file
descriptors from install_t, otherwise they fail to load dynamic
libraries. Thus, this rule needs to be added to
testsuite_domain_type_minimal() so that the testuite ca run successfully
on OSTree systems.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 policy/test_policy.if | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/policy/test_policy.if b/policy/test_policy.if
index b20baad..e590f0b 100644
--- a/policy/test_policy.if
+++ b/policy/test_policy.if
@@ -37,6 +37,7 @@ interface(`testsuite_domain_type',`
 interface(`testsuite_domain_type_minimal',`
 	gen_require(`
 		type setrans_var_run_t;
+		type install_t;
 	')
 
 	testsuite_domain_type_common($1)
@@ -46,6 +47,7 @@ interface(`testsuite_domain_type_minimal',`
 	allow $1 proc_t:lnk_file { read };
 	allow $1 self:dir { search };
 	allow $1 self:file { open read write };
+	allow $1 install_t:fd use; # for rpm-ostree --apply-live magic
 	dontaudit $1 security_t:filesystem getattr;
 	dontaudit $1 self:file getattr;
 	dontaudit $1 setrans_var_run_t:dir search;
-- 
2.43.0


             reply	other threads:[~2024-02-08 16:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08 16:11 Ondrej Mosnacek [this message]
2024-02-12  9:58 ` [PATCH testsuite] policy: fix testsuite_domain_type_minimal() to work with rpm-ostree Ondrej Mosnacek

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=20240208161125.620477-1-omosnace@redhat.com \
    --to=omosnace@redhat.com \
    --cc=selinux@vger.kernel.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.