@@ -64,6 +64,7 @@
#define TST_TAINT_K (1 << 15) /* kernel has been live-patched */
#define TST_TAINT_X (1 << 16) /* auxiliary taint, for distro's use */
#define TST_TAINT_T (1 << 17) /* kernel was built with the struct randomization plugin */
+#define TST_TAINT_N (1 << 18) /* an in-kernel test has been run */
/*
* Initialize and prepare support for checking tainted kernel. Called
@@ -33,6 +33,7 @@ static const char *const taint_strings[] = {
"K (Live patched)",
"X (Auxilary)",
"T (Built with struct randomization)",
+ "N (In-kernel test has been run)",
};
static unsigned int tst_taint_read(void)
@@ -50,7 +51,10 @@ static int tst_taint_check_kver(unsigned int mask)
int r2;
int r3 = 0;
- if (mask & TST_TAINT_X) {
+ if (mask & TST_TAINT_N) {
+ r1 = 6;
+ r2 = 0;
+ } else if (mask & TST_TAINT_X) {
r1 = 4;
r2 = 15;
} else if (mask & TST_TAINT_K) {
Added in kernel v6.0-rc1, commit 2852ca7fba9f7 ("panic: Taint kernel if tests are run"). Signed-off-by: Petr Vorel <pvorel@suse.cz> --- include/tst_taint.h | 1 + lib/tst_taint.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)