public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Milos Malik <mmalik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: test if colord can use NoNewPrivileges
Date: Fri, 11 Sep 2026 13:21:21 GMT	[thread overview]
Message-ID: <178913288125.1.4876000797188101918.tests-selinux-c7297bd7a3d5@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : c7297bd7a3d512bb861d16685c1c95019520acc6
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2024-02-06T15:49:35+00:00
            Stats  : +13/-3 in 3 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/c7297bd7a3d512bb861d16685c1c95019520acc6?branch=pr775-checkpolicy-revdeps

            Log:
            test if colord can use NoNewPrivileges

Recently, openQA testing of new colord version (1.4.7-1) revealed
that SELinux prevents the colord process transition from init_t
to colord_t domain. The TC reproduces the situation.

In order to support the existing colord functionality together with
the newly added systemd unit option (NoNewPrivileges=true), I believe
that SELinux policy should allow the action. The TC looks for
appropriate policy rules and file context patterns.

The TC covers BZ#2259679.

---
diff --git a/selinux-policy/colord-and-similar/Makefile b/selinux-policy/colord-and-similar/Makefile
index 4a609b8..32ada87 100644
--- a/selinux-policy/colord-and-similar/Makefile
+++ b/selinux-policy/colord-and-similar/Makefile
@@ -55,7 +55,7 @@ $(METADATA): Makefile
 	@echo "TestTime:        10m" >> $(METADATA)
 	@echo "RunFor:          selinux-policy" >> $(METADATA)
 	@echo "RunFor:          colord" >> $(METADATA)
-	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted glib2 setools-console colord initscripts expect" >> $(METADATA)
+	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted glib2 setools-console colord /usr/sbin/service expect" >> $(METADATA)
 	@echo "RhtsRequires:    library(selinux-policy/common)" >> $(METADATA)
 	@echo "Priority:        Normal" >> $(METADATA)
 	@echo "License:         GPLv2" >> $(METADATA)
@@ -69,6 +69,7 @@ $(METADATA): Makefile
 	@echo "Bug:             1421247" >> $(METADATA) # RHEL-7
 	@echo "Bug:             1460480" >> $(METADATA) # RHEL-7
 	@echo "Bug:             1772669" >> $(METADATA) # RHEL-8
+	@echo "Bug:             2259679" >> $(METADATA) # Fedora 40
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/colord-and-similar/main.fmf b/selinux-policy/colord-and-similar/main.fmf
index 559be9e..7e4ba6a 100644
--- a/selinux-policy/colord-and-similar/main.fmf
+++ b/selinux-policy/colord-and-similar/main.fmf
@@ -17,7 +17,7 @@ recommend:
   - glib2
   - setools-console
   - colord
-  - initscripts
+  - /usr/sbin/service
   - expect
 environment:
     AVC_ERROR: +no_avc_check
@@ -29,7 +29,6 @@ tag:
   - NoRHEL4
   - NoRHEL5
   - NoRHEL6
-  - RHEL8
   - TIPpass
   - TIPpass_FIPS
   - TIPpass_Security
@@ -48,6 +47,7 @@ link:
   - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1772669
   - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1951114
   - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1878094
+  - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2259679
 adjust:
   - enabled: false
     when: distro == rhel-4, rhel-5, rhel-6

diff --git a/selinux-policy/colord-and-similar/runtest.sh b/selinux-policy/colord-and-similar/runtest.sh
index 4d7aece..9cd88f0 100755
--- a/selinux-policy/colord-and-similar/runtest.sh
+++ b/selinux-policy/colord-and-similar/runtest.sh
@@ -142,6 +142,15 @@ rlJournalStart
         rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "restart status stop status" 1
     rlPhaseEnd
 
+    if rlIsFedora ; then
+    rlPhaseStartTest "bz#2259679"
+        rlSEMatchPathCon "/usr/libexec/colord" "colord_exec_t"
+        rlSEMatchPathCon "/var/lib/colord/mapping.db" "colord_var_lib_t"
+        rlSESearchRule "allow init_t colord_t : process2 { nnp_transition } [ ]"
+        rlSESearchRule "allow colord_t colord_var_lib_t : file { read write } [ ]"
+    rlPhaseEnd
+    fi
+
     rlPhaseStartCleanup
         sleep 2
         rlSECheckAVC

                 reply	other threads:[~2026-09-11 13:21 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=178913288125.1.4876000797188101918.tests-selinux-c7297bd7a3d5@fedoraproject.org \
    --to=mmalik@redhat.com \
    --cc=git-commits@fedoraproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox