public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: kernel-confined-exec: refine policy expectations
@ 2026-09-11 13:20 Ondrej Mosnacek
0 siblings, 0 replies; only message in thread
From: Ondrej Mosnacek @ 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 : ca2936720a77621e477b7223fb4efc3cf433097f
Author : Ondrej Mosnacek <omosnace@redhat.com>
Date : 2023-01-27T16:36:09+00:00
Stats : +8/-4 in 1 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/ca2936720a77621e477b7223fb4efc3cf433097f?branch=pr775-checkpolicy-revdeps
Log:
kernel-confined-exec: refine policy expectations
Don't be strict about the 'execute' permission and instead check for
[the lack of] transitions. Also drop entrypoint checking as it's not
really relevant.
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
diff --git a/selinux-policy/kernel-confined-exec/runtest.sh b/selinux-policy/kernel-confined-exec/runtest.sh
index 35f0b58..1f59a75 100755
--- a/selinux-policy/kernel-confined-exec/runtest.sh
+++ b/selinux-policy/kernel-confined-exec/runtest.sh
@@ -39,12 +39,16 @@ rlJournalStart
rlPhaseStartTest "Policy rules"
rlLog "kernel_t shouldn't be allowed to execute any file without transition"
+ # Only check execute_no_trans and a couple of unexpected type
+ # transitions. Plain 'execute' has to be allowed broadly due to
+ # overlayfs mounter checks. (Think overlayfs mounted before policy
+ # is loaded.)
rlSESearchRule "allow kernel_t file_type:file { execute_no_trans } []" 1 \
"kernel_t shouldn't be allowed to execute any file without transition"
- rlSESearchRule "allow kernel_t user_home_t:file { execute entrypoint }" 1 \
- "kernel_t shouldn't be allowed to execute files in user home directories"
- rlSESearchRule "allow kernel_t user_tmp_t:file { execute entrypoint }" 1 \
- "kernel_t shouldn't be allowed to execute user temporary files"
+ rlSESearchRule "type_transition kernel_t user_home_t:process domain;" 1 \
+ "kernel_t shouldn't have any transition defined over files in user home directories"
+ rlSESearchRule "type_transition kernel_t user_tmp_t:process domain;" 1 \
+ "kernel_t shouldn't have any transition defined over user temporary files"
rlPhaseEnd
rlPhaseStartTest "Legit modprobe"
^ 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: kernel-confined-exec: refine policy expectations Ondrej Mosnacek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox