public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/2] Update taint
@ 2024-06-18 10:31 Petr Vorel
  2024-06-18 10:31 ` [LTP] [PATCH 1/2] tst_taint: Add TST_TAINT_N Petr Vorel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Petr Vorel @ 2024-06-18 10:31 UTC (permalink / raw)
  To: ltp

Petr Vorel (2):
  tst_taint: Add TST_TAINT_N
  tst_taint: Assume kernel > 4.0

 include/tst_taint.h |  1 +
 lib/tst_taint.c     | 43 ++++++-------------------------------------
 2 files changed, 7 insertions(+), 37 deletions(-)

-- 
2.45.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 1/2] tst_taint: Add TST_TAINT_N
  2024-06-18 10:31 [LTP] [PATCH 0/2] Update taint Petr Vorel
@ 2024-06-18 10:31 ` Petr Vorel
  2024-06-18 10:31 ` [LTP] [PATCH 2/2] tst_taint: Assume kernel > 4.0 Petr Vorel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-06-18 10:31 UTC (permalink / raw)
  To: ltp

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(-)

diff --git a/include/tst_taint.h b/include/tst_taint.h
index bd8076c1c..b2b201688 100644
--- a/include/tst_taint.h
+++ b/include/tst_taint.h
@@ -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
diff --git a/lib/tst_taint.c b/lib/tst_taint.c
index 58b96f6eb..f28932609 100644
--- a/lib/tst_taint.c
+++ b/lib/tst_taint.c
@@ -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) {
-- 
2.45.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH 2/2] tst_taint: Assume kernel > 4.0
  2024-06-18 10:31 [LTP] [PATCH 0/2] Update taint Petr Vorel
  2024-06-18 10:31 ` [LTP] [PATCH 1/2] tst_taint: Add TST_TAINT_N Petr Vorel
@ 2024-06-18 10:31 ` Petr Vorel
  2024-06-18 11:52 ` [LTP] [PATCH 0/2] Update taint Li Wang
  2024-06-19 11:44 ` Martin Doucha
  3 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-06-18 10:31 UTC (permalink / raw)
  To: ltp

LTP recently (9e9654cf2) raised minimal kernel support to 4.4.
Therefore remove checks for kernel < 4.0.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_taint.c | 37 +------------------------------------
 1 file changed, 1 insertion(+), 36 deletions(-)

diff --git a/lib/tst_taint.c b/lib/tst_taint.c
index f28932609..94459523e 100644
--- a/lib/tst_taint.c
+++ b/lib/tst_taint.c
@@ -60,43 +60,8 @@ static int tst_taint_check_kver(unsigned int mask)
 	} else if (mask & TST_TAINT_K) {
 		r1 = 4;
 		r2 = 0;
-	} else if (mask & TST_TAINT_L) {
-		r1 = 3;
-		r2 = 17;
-	} else if (mask & TST_TAINT_E) {
-		r1 = 3;
-		r2 = 15;
-	} else if (mask & TST_TAINT_O) {
-		r1 = 3;
-		r2 = 2;
-	} else if (mask & TST_TAINT_I) {
-		r1 = 2;
-		r2 = 6;
-		r3 = 35;
-	} else if (mask & TST_TAINT_C) {
-		r1 = 2;
-		r2 = 6;
-		r3 = 28;
-	} else if (mask & TST_TAINT_W) {
-		r1 = 2;
-		r2 = 6;
-		r3 = 26;
-	} else if (mask & TST_TAINT_A) {
-		r1 = 2;
-		r2 = 6;
-		r3 = 25;
-	} else if (mask & TST_TAINT_D) {
-		r1 = 2;
-		r2 = 6;
-		r3 = 23;
-	} else if (mask & TST_TAINT_U) {
-		r1 = 2;
-		r2 = 6;
-		r3 = 21;
 	} else {
-		r1 = 2;
-		r2 = 6;
-		r3 = 16;
+		return 1;
 	}
 
 	return tst_kvercmp(r1, r2, r3);
-- 
2.45.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH 0/2] Update taint
  2024-06-18 10:31 [LTP] [PATCH 0/2] Update taint Petr Vorel
  2024-06-18 10:31 ` [LTP] [PATCH 1/2] tst_taint: Add TST_TAINT_N Petr Vorel
  2024-06-18 10:31 ` [LTP] [PATCH 2/2] tst_taint: Assume kernel > 4.0 Petr Vorel
@ 2024-06-18 11:52 ` Li Wang
  2024-06-19 11:44 ` Martin Doucha
  3 siblings, 0 replies; 6+ messages in thread
From: Li Wang @ 2024-06-18 11:52 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Both look good to me.

Reviewed-by: Li Wang <liwang@redhat.com>


On Tue, Jun 18, 2024 at 6:32 PM Petr Vorel <pvorel@suse.cz> wrote:

> Petr Vorel (2):
>   tst_taint: Add TST_TAINT_N
>   tst_taint: Assume kernel > 4.0


>  include/tst_taint.h |  1 +
>  lib/tst_taint.c     | 43 ++++++-------------------------------------
>  2 files changed, 7 insertions(+), 37 deletions(-)
>
> --
> 2.45.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH 0/2] Update taint
  2024-06-18 10:31 [LTP] [PATCH 0/2] Update taint Petr Vorel
                   ` (2 preceding siblings ...)
  2024-06-18 11:52 ` [LTP] [PATCH 0/2] Update taint Li Wang
@ 2024-06-19 11:44 ` Martin Doucha
  2024-06-19 17:14   ` Petr Vorel
  3 siblings, 1 reply; 6+ messages in thread
From: Martin Doucha @ 2024-06-19 11:44 UTC (permalink / raw)
  To: Petr Vorel, ltp

Hi,
for the whole patchset:
Reviewed-by: Martin Doucha <mdoucha@suse.cz>

On 18. 06. 24 12:31, Petr Vorel wrote:
> Petr Vorel (2):
>    tst_taint: Add TST_TAINT_N
>    tst_taint: Assume kernel > 4.0
> 
>   include/tst_taint.h |  1 +
>   lib/tst_taint.c     | 43 ++++++-------------------------------------
>   2 files changed, 7 insertions(+), 37 deletions(-)
> 

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH 0/2] Update taint
  2024-06-19 11:44 ` Martin Doucha
@ 2024-06-19 17:14   ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-06-19 17:14 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,

thanks a lot, merged!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-19 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-18 10:31 [LTP] [PATCH 0/2] Update taint Petr Vorel
2024-06-18 10:31 ` [LTP] [PATCH 1/2] tst_taint: Add TST_TAINT_N Petr Vorel
2024-06-18 10:31 ` [LTP] [PATCH 2/2] tst_taint: Assume kernel > 4.0 Petr Vorel
2024-06-18 11:52 ` [LTP] [PATCH 0/2] Update taint Li Wang
2024-06-19 11:44 ` Martin Doucha
2024-06-19 17:14   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox