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 systemd can read symlinks under /var/lib/
Date: Fri, 11 Sep 2026 13:20:14 GMT [thread overview]
Message-ID: <178913281401.1.14391663793965007181.tests-selinux-efc6c0b001cc@fedoraproject.org> (raw)
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
reply other threads:[~2026-09-11 13:20 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=178913281401.1.14391663793965007181.tests-selinux-efc6c0b001cc@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