Skip to content

Commit ccc2f5b

Browse files
keesgregkh
authored andcommitted
selftests/lkdtm: Reset WARN_ONCE to avoid false negatives
[ Upstream commit 4fccc8c ] Since we expect to see warnings every time for many tests, just reset the WARN_ONCE flags each time the script runs. Fixes: 46d1a0f ("selftests/lkdtm: Add tests for LKDTM targets") Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20200625203704.317097-4-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1e84529 commit ccc2f5b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • tools/testing/selftests/lkdtm

‎tools/testing/selftests/lkdtm/run.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#
99
set -e
1010
TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT
11+
CLEAR_ONCE=/sys/kernel/debug/clear_warn_once
1112
KSELFTEST_SKIP_TEST=4
1213

1314
# Verify we have LKDTM available in the kernel.
@@ -67,6 +68,11 @@ cleanup() {
6768
}
6869
trap cleanup EXIT
6970

71+
# Reset WARN_ONCE counters so we trip it each time this runs.
72+
if [ -w $CLEAR_ONCE ] ; then
73+
echo 1 > $CLEAR_ONCE
74+
fi
75+
7076
# Save existing dmesg so we can detect new content below
7177
dmesg > "$DMESG"
7278

0 commit comments

Comments
 (0)