public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: Add a test for bogus warning in selinux_ima_measure_state()
Date: Fri, 11 Sep 2026 13:19:57 GMT [thread overview]
Message-ID: <178913279795.1.14984453650072216595.tests-selinux-fd520ce6f3cd@fedoraproject.org> (raw)
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
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=178913279795.1.14984453650072216595.tests-selinux-fd520ce6f3cd@fedoraproject.org \
--to=omosnace@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