public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: test if systemd-machined can open+ioctl /dev/vsock
@ 2026-09-11 13:22 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:22 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 1b8d7bd95f48a4120ba7aacaf90afd58d33756d3
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2025-01-22T07:14:13+00:00
            Stats  : +9/-0 in 3 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/1b8d7bd95f48a4120ba7aacaf90afd58d33756d3?branch=pr775-checkpolicy-revdeps

            Log:
            test if systemd-machined can open+ioctl /dev/vsock

Recent systemd-machined + selinux-policy testing revealed that
SELinux prevents the systemd-machined processes from accessing
the /dev/vsock device. The TC reproduces the situation.

In order to support the expected systemd-machined functionality,
I believe that SELinux policy should allow this access. The TC
looks for appropriate policy rules and file context patterns.

The TC covers RHEL-74280.

---
diff --git a/selinux-policy/systemd-machined-and-similar/Makefile b/selinux-policy/systemd-machined-and-similar/Makefile
index cb3f07b..d34d9a0 100644
--- a/selinux-policy/systemd-machined-and-similar/Makefile
+++ b/selinux-policy/systemd-machined-and-similar/Makefile
@@ -67,6 +67,7 @@ $(METADATA): Makefile
 	@echo "Bug:             1900869" >> $(METADATA) # Fedora 33
 	@echo "Bug:             1900888" >> $(METADATA) # Fedora 35
 	@echo "Bug:             RHEL-49567" >> $(METADATA) # RHEL-10
+	@echo "Bug:             RHEL-74280" >> $(METADATA) # RHEL-10
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/systemd-machined-and-similar/main.fmf b/selinux-policy/systemd-machined-and-similar/main.fmf
index 617fc5e..4dc0eb6 100644
--- a/selinux-policy/systemd-machined-and-similar/main.fmf
+++ b/selinux-policy/systemd-machined-and-similar/main.fmf
@@ -35,6 +35,7 @@ link:
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1900869
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1900888
   - verifies: https://issues.redhat.com/browse/RHEL-49567
+  - verifies: https://issues.redhat.com/browse/RHEL-74280
 adjust:
   - enabled: false
     when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-alt-7

diff --git a/selinux-policy/systemd-machined-and-similar/runtest.sh b/selinux-policy/systemd-machined-and-similar/runtest.sh
index 422908e..61fade7 100755
--- a/selinux-policy/systemd-machined-and-similar/runtest.sh
+++ b/selinux-policy/systemd-machined-and-similar/runtest.sh
@@ -104,6 +104,13 @@ rlJournalStart
         rlRun "machinectl"
     rlPhaseEnd
 
+    if rlIsRHEL 10 || rlIsCentOS 10 ; then
+    rlPhaseStartTest "RHEL-74280"
+        rlSEMatchPathCon "/dev/vsock" "vsock_device_t"
+        rlSESearchRule "allow systemd_machined_t vsock_device_t : chr_file { getattr open read ioctl } [ ]"
+    rlPhaseEnd
+    fi
+
     rlPhaseStartTest "real scenario -- standalone service"
         if ! rlSEDefined ${PROCESS_CONTEXT} ; then
             PROCESS_CONTEXT="unconfined_service_t"

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

only message in thread, other threads:[~2026-09-11 13:22 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:22 [tests/selinux] pr775-checkpolicy-revdeps: test if systemd-machined can open+ioctl /dev/vsock Milos Malik

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