public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: Add a test for bogus warning in selinux_ima_measure_state()
@ 2026-09-11 13:19 Ondrej Mosnacek
0 siblings, 0 replies; only message in thread
From: Ondrej Mosnacek @ 2026-09-11 13:19 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : fd520ce6f3cd0e83db4c306bd2e0958ef8518ce5
Author : Ondrej Mosnacek <omosnace@redhat.com>
Date : 2022-05-10T15:31:19+02:00
Stats : +54/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/fd520ce6f3cd0e83db4c306bd2e0958ef8518ce5?branch=pr775-checkpolicy-revdeps
Log:
Add a test for bogus warning in selinux_ima_measure_state()
Verifies:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce2fc710c9d2b25afc710f49bb2065b4439a62bc
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
diff --git a/kernel/bogus-warning-in-selinux_ima_measure_state/main.fmf b/kernel/bogus-warning-in-selinux_ima_measure_state/main.fmf
new file mode 100644
index 0000000..57e2859
--- /dev/null
+++ b/kernel/bogus-warning-in-selinux_ima_measure_state/main.fmf
@@ -0,0 +1,22 @@
+summary: Regression test for bogus WARNING in SELinux
+description: |
+ Verify that selinux_ima_measure_state() doesn't trigger a bogus
+ lock-related WARN_ON() when the mutex is held by another task.
+contact: Ondrej Mosnacek <omosnace@redhat.com>
+component:
+- kernel
+framework: beakerlib
+require:
+- policycoreutils
+duration: 5m
+tier: 2
+enabled: true
+adjust:
+- enabled: false
+ when: distro < fedora-36
+ because: some kernels on Fedora 35 and below don't have the fix
+- enabled: false
+ when: distro < rhel-9.1
+ because: not expected to be fixed earlier than RHEL-9.1
+link:
+- verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2050966
diff --git a/kernel/bogus-warning-in-selinux_ima_measure_state/runtest.sh b/kernel/bogus-warning-in-selinux_ima_measure_state/runtest.sh
new file mode 100755
index 0000000..061b9c7
--- /dev/null
+++ b/kernel/bogus-warning-in-selinux_ima_measure_state/runtest.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# SPDX-License-Identifier: GPLv2
+# Copyright (c) 2022 Red Hat, Inc.
+# Author: Ondrej Mosnacek <omosnace@redhat.com>
+
+# Include Beakerlib environment
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+function trigger_the_bug() {
+ while true; do echo 0 > /sys/fs/selinux/checkreqprot; done &
+ while true; do load_policy; done &
+
+ sleep 15s
+
+ kill $(jobs -p)
+ wait $(jobs -p)
+ return 0
+}
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlRun "uname -r" 0 "Show the running kernel version"
+ rlPhaseEnd
+
+ rlPhaseStartTest
+ rlRun "trigger_the_bug" 0 "Run the reproducer"
+ rlRun "dmesg | grep -E 'WARNING:.*selinux_ima_measure_state'" 1 \
+ "Check that dmesg doesn't contain relevant WARNING lines"
+ rlPhaseEnd
+rlJournalPrintText
+rlJournalEnd
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:19 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:19 [tests/selinux] pr775-checkpolicy-revdeps: Add a test for bogus warning in selinux_ima_measure_state() Ondrej Mosnacek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox