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-timesyncd can watch the / directory
Date: Fri, 11 Sep 2026 13:19:01 GMT	[thread overview]
Message-ID: <178913274172.1.1493664719276529157.tests-selinux-ca4b8c77c1f3@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : ca4b8c77c1f3afd237b06bf05bc3df8d19f12188
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2021-04-28T06:34:56+00:00
            Stats  : +8/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/ca4b8c77c1f3afd237b06bf05bc3df8d19f12188?branch=pr775-checkpolicy-revdeps

            Log:
            test if systemd-timesyncd can watch the / directory

Recent testing revealed, that systemd-timesyncd service wants to
use the inotify_add_watch syscall on the root directory during boot.
Unfortunately, SELinux policy denies that access.
I believe that the access is harmless and should be allowed.
The TC looks for appropriate policy rule.

The TC covers BZ#1949315.

---
diff --git a/selinux-policy/systemd-timesyncd-and-similar/Makefile b/selinux-policy/systemd-timesyncd-and-similar/Makefile
index 25410b7..e47a5c9 100644
--- a/selinux-policy/systemd-timesyncd-and-similar/Makefile
+++ b/selinux-policy/systemd-timesyncd-and-similar/Makefile
@@ -73,6 +73,7 @@ $(METADATA): Makefile
 	@echo "Bug:             1694272" >> $(METADATA) # Fedora 29
 	@echo "Bug:             1822131" >> $(METADATA) # Fedora 32
 	@echo "Bug:             1869979" >> $(METADATA) # RHEL-8
+	@echo "Bug:             1949315" >> $(METADATA) # Fedora 34
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/systemd-timesyncd-and-similar/runtest.sh b/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
index 18950fe..9fc18cf 100755
--- a/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
+++ b/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
@@ -102,6 +102,13 @@ rlJournalStart
         rlSESearchRule "allow systemd_timedated_t efivarfs_t : file { getattr open read } [ ]"
     rlPhaseEnd
 
+    rlPhaseStartTest "bz#1949315"
+        rlSEMatchPathCon "/" "root_t"
+        rlSEMatchPathCon "/run" "var_run_t"
+        rlSESearchRule "allow systemd_timedated_t root_t : dir { watch } [ ]"
+        rlSESearchRule "allow systemd_timedated_t var_run_t : dir { watch } [ ]"
+    rlPhaseEnd
+
     rlPhaseStartTest "real scenario -- standalone service"
         rlRun "echo ${ROOT_PASSWORD} | passwd --stdin root"
         if ! rlSEDefined ${PROCESS_CONTEXT} ; then

                 reply	other threads:[~2026-09-11 13:19 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=178913274172.1.1493664719276529157.tests-selinux-ca4b8c77c1f3@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