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 bootupd can search under /sys/firmware/efi/efivars
Date: Fri, 11 Sep 2026 13:21:40 GMT	[thread overview]
Message-ID: <178913290080.1.4942515374235182055.tests-selinux-c162dadbbe67@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : c162dadbbe67914a7d959a694e3c46186efd70c3
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2024-05-20T13:20:55+00:00
            Stats  : +11/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/c162dadbbe67914a7d959a694e3c46186efd70c3?branch=pr775-checkpolicy-revdeps

            Log:
            test if bootupd can search under /sys/firmware/efi/efivars

A recent bootupd + selinux-policy testing revealed that SELinux
prevents the bootupd daemon from getattr/search-ing (syscall=statx)
the /sys/firmware/efi/efivars directory. The TC reproduces the
situation on machines equipped by EFI system partition.

In order to support the bootupd functions on EFI machines, I believe
that SELinux policy should allow this access. The TC looks for
appropriate policy rules and file context patterns.

The TC covers RHEL-36289.

---
diff --git a/selinux-policy/bootupd-and-similar/Makefile b/selinux-policy/bootupd-and-similar/Makefile
index f23235f..3d0b32d 100644
--- a/selinux-policy/bootupd-and-similar/Makefile
+++ b/selinux-policy/bootupd-and-similar/Makefile
@@ -65,6 +65,7 @@ $(METADATA): Makefile
 	@echo "Bug:             2029478" >> $(METADATA) # RHEL-9
 	@echo "Bug:             2044508" >> $(METADATA) # RHEL-9
 	@echo "Bug:             2218106" >> $(METADATA) # Fedora rawhide
+	@echo "Bug:             RHEL-36289" >> $(METADATA) # RHEL-9
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/bootupd-and-similar/main.fmf b/selinux-policy/bootupd-and-similar/main.fmf
index 758cad7..5bb49e6 100644
--- a/selinux-policy/bootupd-and-similar/main.fmf
+++ b/selinux-policy/bootupd-and-similar/main.fmf
@@ -35,6 +35,7 @@ link:
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2029478
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2044508
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2218106
+  - verifies: https://issues.redhat.com/browse/RHEL-36289
 adjust:
   - enabled: false
     when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-8, centos-stream-8

diff --git a/selinux-policy/bootupd-and-similar/runtest.sh b/selinux-policy/bootupd-and-similar/runtest.sh
index 06a8156..99d2510 100755
--- a/selinux-policy/bootupd-and-similar/runtest.sh
+++ b/selinux-policy/bootupd-and-similar/runtest.sh
@@ -34,7 +34,7 @@ FILE_PATH="/usr/libexec/bootupd"
 SERVICE_PACKAGE="bootupd"
 SERVICE_NAME="bootupd"
 PROCESS_NAME="bootupd"
-if rlIsFedora || rlIsRHEL '>= 10' || rlIsCentOS '>= 10' ; then
+if rlIsFedora || rlIsRHEL '>= 9.5' || rlIsRHEL '>= 10' || rlIsCentOS '>= 10' ; then
     FILE_CONTEXT="bootupd_exec_t"
     PROCESS_CONTEXT="bootupd_t"
 else
@@ -74,6 +74,14 @@ rlJournalStart
         rlSESearchRule "allow ${PROCESS_CONTEXT} dosfs_t : dir { getattr search } [ ]"
     rlPhaseEnd
 
+    rlPhaseStartTest "RHEL-36289"
+        rlSEMatchPathCon "/usr/libexec/bootupd" "${FILE_CONTEXT}"
+        if [ -d /sys/firmware/efi/efivars ] ; then
+            rlRun "ls -RlZ /sys/firmware/efi/efivars"
+        fi
+        rlSESearchRule "allow ${PROCESS_CONTEXT} efivarfs_t : dir { getattr search } [ ]"
+    rlPhaseEnd
+
     rlPhaseStartTest "real scenario -- standalone service"
         if ! rlSEDefined ${PROCESS_CONTEXT} ; then
             # for RHELs where the SELinux domain does not exist yet

                 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=178913290080.1.4942515374235182055.tests-selinux-c162dadbbe67@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