public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: test if bootupd can search under /sys/firmware/efi/efivars
@ 2026-09-11 13:21 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:21 UTC (permalink / raw)
  To: git-commits

            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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:21 [tests/selinux] pr775-checkpolicy-revdeps: test if bootupd can search under /sys/firmware/efi/efivars Milos Malik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox