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 fapolicyd can watch* various mount points
Date: Fri, 11 Sep 2026 13:19:12 GMT [thread overview]
Message-ID: <178913275214.1.12229062275513604560.tests-selinux-69871d74cc78@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 69871d74cc78569e129c2f4b83fc0b06c2984a10
Author : Milos Malik <mmalik@redhat.com>
Date : 2021-05-20T10:47:43+00:00
Stats : +16/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/69871d74cc78569e129c2f4b83fc0b06c2984a10?branch=pr775-checkpolicy-revdeps
Log:
test if fapolicyd can watch* various mount points
Recent testing of fapolicyd with the latest SELinux policy, which
introduced various watch* permission, revealed that SELinux prevents
the fapolicyd from using fanotify_mark syscall on various mount
points like /dev/shm, /boot etc. The TC reproduces the situation
and it also looks for appropriate policy rules.
I believe these actions should be allowed, because they are expected
from the fapolicyd process.
The TC covers BZ#1932225.
---
diff --git a/selinux-policy/fapolicyd-and-similar/Makefile b/selinux-policy/fapolicyd-and-similar/Makefile
index 5ceb8a2..cdfcfed 100644
--- a/selinux-policy/fapolicyd-and-similar/Makefile
+++ b/selinux-policy/fapolicyd-and-similar/Makefile
@@ -66,6 +66,7 @@ $(METADATA): Makefile
@echo "Bug: 1865818" >> $(METADATA) # RHEL-8
@echo "Bug: 1874491" >> $(METADATA) # Fedora 33
@echo "Bug: 1876538" >> $(METADATA) # Fedora 33
+ @echo "Bug: 1932225" >> $(METADATA)
rhts-lint $(METADATA)
diff --git a/selinux-policy/fapolicyd-and-similar/runtest.sh b/selinux-policy/fapolicyd-and-similar/runtest.sh
index 720f008..6709ce5 100755
--- a/selinux-policy/fapolicyd-and-similar/runtest.sh
+++ b/selinux-policy/fapolicyd-and-similar/runtest.sh
@@ -88,6 +88,21 @@ rlJournalStart
rlSESearchRule "allow fapolicyd_t rpm_var_lib_t : file { create } [ ]"
rlPhaseEnd
+ if seinfo --common file -x | grep -q watch ; then
+ rlPhaseStartTest "bz#1932225"
+ rlSEMatchPathCon "/boot" "boot_t"
+ rlSEMatchPathCon "/" "root_t"
+ rlSEMatchPathCon "/dev/shm" "tmpfs_t"
+ rlSEMatchPathCon "/tmp" "tmp_t"
+ rlSEMatchPathCon "/run/user/0" "user_tmp_t"
+ rlSESearchRule "allow fapolicyd_t boot_t : dir { watch_mount watch_with_perm } [ ]"
+ rlSESearchRule "allow fapolicyd_t root_t : dir { watch_mount watch_with_perm } [ ]"
+ rlSESearchRule "allow fapolicyd_t tmpfs_t : dir { watch_mount watch_with_perm } [ ]"
+ rlSESearchRule "allow fapolicyd_t tmp_t : dir { watch_mount watch_with_perm } [ ]"
+ rlSESearchRule "allow fapolicyd_t user_tmp_t : dir { watch_mount watch_with_perm } [ ]"
+ rlPhaseEnd
+ fi
+
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=178913275214.1.12229062275513604560.tests-selinux-69871d74cc78@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