public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: test if valkey service can manage RDMA sockets
@ 2026-09-11 13:23 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:23 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : a47e7720466068f760bf56d6faee29ad812c39e1
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2026-03-26T18:04:17+01:00
            Stats  : +12/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/a47e7720466068f760bf56d6faee29ad812c39e1?branch=pr775-checkpolicy-revdeps

            Log:
            test if valkey service can manage RDMA sockets

Recent valkey + selinux-policy testing revealed that SELinux prevents
the valkey-server processes from creating and manipulating of RDMA
sockets when the valkey-rdma package is installed. The TC reproduces
the situation.

In order to enable the functions brought by the valkey-rdma package,
I believe that SELinux policy should allow the access. The TC looks
for appropriate policy rules and file context patterns.

The TC covers RHEL-154814 and RHEL-161115.

---
diff --git a/selinux-policy/valkey-and-similar/Makefile b/selinux-policy/valkey-and-similar/Makefile
index 2e576bf..e194474 100644
--- a/selinux-policy/valkey-and-similar/Makefile
+++ b/selinux-policy/valkey-and-similar/Makefile
@@ -55,7 +55,7 @@ $(METADATA): Makefile
 	@echo "TestTime:        10m" >> $(METADATA)
 	@echo "RunFor:          selinux-policy" >> $(METADATA)
 	@echo "RunFor:          valkey" >> $(METADATA)
-	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console valkey /usr/sbin/service" >> $(METADATA)
+	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console valkey /usr/sbin/service valkey-rdma" >> $(METADATA)
 	@echo "RhtsRequires:    library(selinux-policy/common)" >> $(METADATA)
 	@echo "Priority:        Normal" >> $(METADATA)
 	@echo "License:         GPLv2" >> $(METADATA)
@@ -65,6 +65,8 @@ $(METADATA): Makefile
 	@echo "Releases:        -RHEL4 -RHEL5 -RHEL6 -RHEL7 -RHEL8" >> $(METADATA)
 	@echo "Bug:             RHEL-102631" >> $(METADATA) # RHEL-10
 	@echo "Bug:             RHEL-108982" >> $(METADATA) # RHEL-9
+	@echo "Bug:             RHEL-154814" >> $(METADATA) # RHEL-10
+	@echo "Bug:             RHEL-161115" >> $(METADATA) # RHEL-9
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/valkey-and-similar/main.fmf b/selinux-policy/valkey-and-similar/main.fmf
index af010b8..16ddad7 100644
--- a/selinux-policy/valkey-and-similar/main.fmf
+++ b/selinux-policy/valkey-and-similar/main.fmf
@@ -18,6 +18,7 @@ recommend:
   - selinux-policy-targeted
   - setools-console
   - valkey
+  - valkey-rdma
   - /usr/sbin/service
 environment:
     AVC_ERROR: +no_avc_check
@@ -27,6 +28,8 @@ tier: '3'
 link:
   - verifies: https://issues.redhat.com/browse/RHEL-102631
   - verifies: https://issues.redhat.com/browse/RHEL-108982
+  - verifies: https://issues.redhat.com/browse/RHEL-154814
+  - verifies: https://issues.redhat.com/browse/RHEL-161115
 tag:
   - Tier3
   - Tier3se

diff --git a/selinux-policy/valkey-and-similar/runtest.sh b/selinux-policy/valkey-and-similar/runtest.sh
index 4a356ed..8b2830d 100755
--- a/selinux-policy/valkey-and-similar/runtest.sh
+++ b/selinux-policy/valkey-and-similar/runtest.sh
@@ -66,6 +66,12 @@ rlJournalStart
         rlSEMatchPathCon "/usr/lib/systemd/system/valkey.service" "redis_unit_file_t"
     rlPhaseEnd
 
+    if rpm -q valkey-rdma >& /dev/null ; then
+    rlPhaseStartTest "RHEL-154814 + RHEL-161115"
+        rlSESearchRule "allow redis_t redis_t : netlink_rdma_socket { getattr create setopt bind } [ ]"
+    rlPhaseEnd
+    fi
+
     if [ -f /usr/lib/systemd/system/${SERVICE_NAME}.service ] ; then
     rlPhaseStartTest "real scenario -- ${SERVICE_NAME} service"
         if ! rlSEDefined ${PROCESS_CONTEXT} ; then

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

only message in thread, other threads:[~2026-09-11 13:23 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:23 [tests/selinux] pr775-checkpolicy-revdeps: test if valkey service can manage RDMA sockets Milos Malik

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