Skip to contentSkip to conversation

lib: tst_taint: Ignore WARN taint flag if already set

PATCH Superseded Jan Stancek 2 participants 3 messages Apr 21, 2020 – Apr 27, 2020 Library code

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lib: tst_taint: Ignore WARN taint flag if already set

This commit changes the library so that it ignores the taint warn flag if it was set prior to the test run. It turns out that the warn taint flag is not well defined and could be easily set on a freshly booted kernel for example when buggy BIOS is detected.

Other recent example is disabling ip forward on kvm guests:
https://github.com/containers/libpod/issues/5815
https://lore.kernel.org/netdev/[email protected]/

---
 lib/tst_taint.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
lib/tst_taint.c +7 -2
index a5dbf77d2941..49146aacbbe9 100644
@@ -82,9 +82,14 @@ void tst_taint_init(unsigned int mask)
 		tst_res(TCONF, "Kernel is too old for requested mask");
 
 	taint_mask = mask;
-
 	taint = tst_taint_read();
-	if ((taint & mask) != 0)
+
+	if (taint & TST_TAINT_W) {
+		tst_res(TCONF, "Ignoring already set kernel warning taint");
+		taint_mask &= ~TST_TAINT_W;
+	}
+
+	if ((taint & taint_mask) != 0)
 		tst_brk(TBROK, "Kernel is already tainted: %u", taint);
 }
 
Signature · 1 line
2.18.1
#1 lore raw

PATCH v2 1/1 lib: tst_taint: Ignore WARN taint flag if already set

Quoted 8 lines · Jan Stancek

This commit changes the library so that it ignores the taint warn flag if it was set prior to the test run. It turns out that the warn taint flag is not well defined and could be easily set on a freshly booted kernel for example when buggy BIOS is detected.

Other recent example is disabling ip forward on kvm guests:
https://github.com/containers/libpod/issues/5815

Quoted 7 lines

https://lore.kernel.org/netdev/[email protected]/

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200422/b0092ef0/attachment.htm>
#2 lore raw

PATCH v2 1/1 lib: tst_taint: Ignore WARN taint flag if already set

----- Original Message -----

Quoted 12 lines · Jan Stancek
Quoted 11 lines

This commit changes the library so that it ignores the taint warn flag if it was set prior to the test run. It turns out that the warn taint flag is not well defined and could be easily set on a freshly booted kernel for example when buggy BIOS is detected.

Other recent example is disabling ip forward on kvm guests:
https://github.com/containers/libpod/issues/5815

https://lore.kernel.org/netdev/[email protected]/

Quoted 7 lines
Quoted 5 lines

Pushed.