Blob Blame History Raw
From 8453d94e42b801baac28b4aaefd1ed984f429ca3 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 17 Jan 2022 21:01:12 +0100
Subject: [PATCH] powerpc/security/mitigation-patching.sh: Support X taint
 flag.

References: bsc#1194305 ltc#195651
Patch-mainline: Never, SUSE specific

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 .../powerpc/security/mitigation-patching.sh        | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/powerpc/security/mitigation-patching.sh b/tools/testing/selftests/powerpc/security/mitigation-patching.sh
--- a/tools/testing/selftests/powerpc/security/mitigation-patching.sh
+++ b/tools/testing/selftests/powerpc/security/mitigation-patching.sh
@@ -36,8 +36,11 @@ fi
 
 tainted=$(cat /proc/sys/kernel/tainted)
 if [[ "$tainted" -ne 0 ]]; then
-    echo "Error: kernel already tainted!" >&2
-    exit 1
+    # X flag when externally supported module loaded on SLE 15
+    if [[ "$tainted" -ne 65536 ]] ; then
+        echo "Error: kernel already tainted!" >&2
+        exit 1
+    fi
 fi
 
 mitigations="barrier_nospec stf_barrier count_cache_flush rfi_flush entry_flush uaccess_flush"
@@ -67,8 +70,11 @@ wait
 
 tainted=$(cat /proc/sys/kernel/tainted)
 if [[ "$tainted" -ne 0 ]]; then
-    echo "Error: kernel became tainted!" >&2
-    exit 1
+    # X flag when externally supported module loaded on SLE 15
+    if [[ "$tainted" -ne 65536 ]] ; then
+        echo "Error: kernel became tainted!" >&2
+        exit 1
+    fi
 fi
 
 echo "OK"
-- 
2.31.1