public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: test if systemd can read symlinks under /var/lib/
@ 2026-09-11 13:20 Milos Malik
0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:20 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : efc6c0b001cc0a48858b9826205080e3d774e6f9
Author : Milos Malik <mmalik@redhat.com>
Date : 2022-10-25T08:14:52+00:00
Stats : +11/-0 in 3 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/efc6c0b001cc0a48858b9826205080e3d774e6f9?branch=pr775-checkpolicy-revdeps
Log:
test if systemd can read symlinks under /var/lib/
The use of DynamicUser and StateDirectory features of systemd
in customer environments revealed that SELinux prevents the systemd
processes from reading the symbolic links under /var/lib directory.
The TC reproduces the situation.
Detailed information can be found at:
* https://www.redhat.com/sysadmin/systemd-secure-services
In order to fully support the systemd secure services feature,
I believe that SELinux policy should allow this access. The TC
looks for appropriate policy rules and file context patterns.
The TC covers BZ#2118784.
---
diff --git a/selinux-policy/systemd-run-and-similar/Makefile b/selinux-policy/systemd-run-and-similar/Makefile
index db39990..9211248 100644
--- a/selinux-policy/systemd-run-and-similar/Makefile
+++ b/selinux-policy/systemd-run-and-similar/Makefile
@@ -63,6 +63,7 @@ $(METADATA): Makefile
@echo "Bug: 1559409" >> $(METADATA) # Fedora 27
@echo "Bug: 1647162" >> $(METADATA) # Fedora 29
@echo "Bug: 1980241" >> $(METADATA) # Fedora 34
+ @echo "Bug: 2118784" >> $(METADATA) # RHEL-8
rhts-lint $(METADATA)
diff --git a/selinux-policy/systemd-run-and-similar/main.fmf b/selinux-policy/systemd-run-and-similar/main.fmf
index 30fce17..0201f70 100644
--- a/selinux-policy/systemd-run-and-similar/main.fmf
+++ b/selinux-policy/systemd-run-and-similar/main.fmf
@@ -35,6 +35,7 @@ link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1559409
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1647162
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1980241
+ - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2118784
adjust:
- enabled: false
when: distro == rhel-4, rhel-5, rhel-6, rhel-7
diff --git a/selinux-policy/systemd-run-and-similar/runtest.sh b/selinux-policy/systemd-run-and-similar/runtest.sh
index b594138..6645068 100755
--- a/selinux-policy/systemd-run-and-similar/runtest.sh
+++ b/selinux-policy/systemd-run-and-similar/runtest.sh
@@ -62,6 +62,15 @@ rlJournalStart
fi
rlPhaseEnd
+ rlPhaseStartTest "bz#2118784"
+ rlSEMatchPathCon "/var/lib" "var_lib_t"
+ rlSEMatchPathCon "/var/lib/myservice0" "var_lib_t"
+ rlSESearchRule "allow init_t var_lib_t : lnk_file { getattr read } [ ]"
+ rlRun "systemd-run -p DynamicUser=yes -p StateDirectory=myservice0 touch /var/lib/myservice0/foo"
+ rlRun "systemd-run -p DynamicUser=yes -p StateDirectory=myservice0 --pipe wc -c /var/lib/myservice0/foo"
+ rlRun "ls -alZ /var/lib/myservice0 /var/lib/private/myservice0"
+ rlPhaseEnd
+
rlPhaseStartCleanup
sleep 2
rlSECheckAVC
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:20 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:20 [tests/selinux] pr775-checkpolicy-revdeps: test if systemd can read symlinks under /var/lib/ Milos Malik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox