All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] fw_load0[12]: Skip on Lockdown and Secure Boot
@ 2026-06-17 20:03 Avinesh Kumar via ltp
  2026-06-17 21:09 ` [LTP] " linuxtestproject.agent
  0 siblings, 1 reply; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-06-17 20:03 UTC (permalink / raw)
  To: ltp

looks like these checks were lost in the recent commit converting
these tests to new API.

tst_module.c:139: TINFO: module signature enforcement: off
insmod: ERROR: could not insert module ltp_fw_load.ko: Key was rejected by service

Fixes: fd2c4d2c25d3 ("fw_load: rewrite test using new LTP API")
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
 testcases/kernel/firmware/fw_load/fw_load01.c | 3 +++
 testcases/kernel/firmware/fw_load/fw_load02.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/testcases/kernel/firmware/fw_load/fw_load01.c b/testcases/kernel/firmware/fw_load/fw_load01.c
index 4b30a3b40..c3d0c8c28 100644
--- a/testcases/kernel/firmware/fw_load/fw_load01.c
+++ b/testcases/kernel/firmware/fw_load/fw_load01.c
@@ -57,6 +57,9 @@ static void setup(void)
 		tst_brk(TCONF, "Skipping test due to read-only %s",
 			LIB_PATH);
 
+	if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0)
+			tst_brk(TCONF, "Cannot load unsigned modules in Lockdown/Secure Boot");
+
 	tst_requires_module_signature_disabled();
 
 	snprintf(fw_size_param, sizeof(fw_size_param), "fw_size=%d", FW_SIZE);
diff --git a/testcases/kernel/firmware/fw_load/fw_load02.c b/testcases/kernel/firmware/fw_load/fw_load02.c
index 8d2063772..0a3a614d0 100644
--- a/testcases/kernel/firmware/fw_load/fw_load02.c
+++ b/testcases/kernel/firmware/fw_load/fw_load02.c
@@ -54,6 +54,9 @@ static void setup(void)
 	char fw_size_param[32];
 	char *tmpdir = tst_tmpdir_path();
 
+	if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0)
+			tst_brk(TCONF, "Cannot load unsigned modules in Lockdown/Secure Boot");
+
 	tst_requires_module_signature_disabled();
 
 	SAFE_FILE_PRINTF(FW_PATH, "%s", tmpdir);
-- 
2.54.0


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

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

* Re: [LTP] fw_load0[12]: Skip on Lockdown and Secure Boot
  2026-06-17 20:03 [LTP] [PATCH] fw_load0[12]: Skip on Lockdown and Secure Boot Avinesh Kumar via ltp
@ 2026-06-17 21:09 ` linuxtestproject.agent
  2026-06-18 11:47   ` [LTP] [PATCH v2] " Avinesh Kumar via ltp
  0 siblings, 1 reply; 6+ messages in thread
From: linuxtestproject.agent @ 2026-06-17 21:09 UTC (permalink / raw)
  To: Avinesh Kumar; +Cc: ltp

Hi Avinesh,

On Wed, Jun 17 2026, Avinesh Kumar wrote:
> fw_load0[12]: Skip on Lockdown and Secure Boot

> +	if (tst_lockdown_enabled() > 0 || tst_secureboot_enabled() > 0)
> +			tst_brk(TCONF, "Cannot load unsigned modules in Lockdown/Secure Boot");

Two issues here:

1) The tst_brk() line is indented with two extra tabs (three total) but
should use one extra tab (two total) per kernel coding style.

2) struct tst_test already provides .skip_in_lockdown and
.skip_in_secureboot fields that perform the same
tst_lockdown_enabled()/tst_secureboot_enabled() checks from the
framework initialization path. Using these declarative fields is the
idiomatic approach:

    static struct tst_test test = {
        ...
        .skip_in_lockdown = 1,
        .skip_in_secureboot = 1,
    };

This would replace the manual if-statement in both fw_load01.c and
fw_load02.c.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

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

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

* [LTP] [PATCH v2] fw_load0[12]: Skip on Lockdown and Secure Boot
  2026-06-17 21:09 ` [LTP] " linuxtestproject.agent
@ 2026-06-18 11:47   ` Avinesh Kumar via ltp
  2026-06-18 11:52     ` Andrea Cervesato via ltp
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-06-18 11:47 UTC (permalink / raw)
  To: ltp

these checks were lost in the recent commit converting
these tests to new API.

tst_module.c:139: TINFO: module signature enforcement: off
insmod: ERROR: could not insert module ltp_fw_load.ko: Key was rejected by service
tst_cmd.c:112: TBROK: 'insmod' exited with a non-zero code 1 at tst_cmd.c:112

with checks added:

tst_security.c:104: TINFO: Kernel lockdown: on
tst_test.c:1467: TCONF: Kernel is locked down, skipping test

Fixes: fd2c4d2c25d3 ("fw_load: rewrite test using new LTP API")
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
Changes in v2:
Use .skip_in_lockdown and .skip_in_secureboot fields in struct tst_test
instead of tst_lockdown_enabled()/tst_secureboot_enabled()
---
 testcases/kernel/firmware/fw_load/fw_load01.c | 2 ++
 testcases/kernel/firmware/fw_load/fw_load02.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/testcases/kernel/firmware/fw_load/fw_load01.c b/testcases/kernel/firmware/fw_load/fw_load01.c
index 4b30a3b40..cdf0d387b 100644
--- a/testcases/kernel/firmware/fw_load/fw_load01.c
+++ b/testcases/kernel/firmware/fw_load/fw_load01.c
@@ -108,4 +108,6 @@ static struct tst_test test = {
 		"CONFIG_FW_LOADER=y|CONFIG_FW_LOADER=m",
 		NULL,
 	},
+	.skip_in_lockdown = 1,
+	.skip_in_secureboot = 1,
 };
diff --git a/testcases/kernel/firmware/fw_load/fw_load02.c b/testcases/kernel/firmware/fw_load/fw_load02.c
index 8d2063772..fbcfd3faf 100644
--- a/testcases/kernel/firmware/fw_load/fw_load02.c
+++ b/testcases/kernel/firmware/fw_load/fw_load02.c
@@ -90,4 +90,6 @@ static struct tst_test test = {
 		{FW_PATH, NULL, TST_SR_TCONF},
 		{},
 	},
+	.skip_in_lockdown = 1,
+	.skip_in_secureboot = 1,
 };
-- 
2.54.0


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

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

* Re: [LTP] [PATCH v2] fw_load0[12]: Skip on Lockdown and Secure Boot
  2026-06-18 11:47   ` [LTP] [PATCH v2] " Avinesh Kumar via ltp
@ 2026-06-18 11:52     ` Andrea Cervesato via ltp
  2026-06-18 11:52     ` Andrea Cervesato via ltp
  2026-06-18 11:53     ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-18 11:52 UTC (permalink / raw)
  To: Avinesh Kumar; +Cc: ltp

Hi
> these checks were lost in the recent commit converting
> these tests to new API.
> 
> tst_module.c:139: TINFO: module signature enforcement: off
> insmod: ERROR: could not insert module ltp_fw_load.ko: Key was rejected by service
> tst_cmd.c:112: TBROK: 'insmod' exited with a non-zero code 1 at tst_cmd.c:112
> 
> with checks added:
> 
> tst_security.c:104: TINFO: Kernel lockdown: on
> tst_test.c:1467: TCONF: Kernel is locked down, skipping test
> 
> Fixes: fd2c4d2c25d3 ("fw_load: rewrite test using new LTP API")
> Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
> ---
> Changes in v2:
> Use .skip_in_lockdown and .skip_in_secureboot fields in struct tst_test
> instead of tst_lockdown_enabled()/tst_secureboot_enabled()
> ---
>  testcases/kernel/firmware/fw_load/fw_load01.c | 2 ++
>  testcases/kernel/firmware/fw_load/fw_load02.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/testcases/kernel/firmware/fw_load/fw_load01.c b/testcases/kernel/firmware/fw_load/fw_load01.c
> index 4b30a3b40..cdf0d387b 100644
> --- a/testcases/kernel/firmware/fw_load/fw_load01.c
> +++ b/testcases/kernel/firmware/fw_load/fw_load01.c
> @@ -108,4 +108,6 @@ static struct tst_test test = {
>  		"CONFIG_FW_LOADER=y|CONFIG_FW_LOADER=m",
>  		NULL,
>  	},
> +	.skip_in_lockdown = 1,
> +	.skip_in_secureboot = 1,
>  };
> diff --git a/testcases/kernel/firmware/fw_load/fw_load02.c b/testcases/kernel/firmware/fw_load/fw_load02.c
> index 8d2063772..fbcfd3faf 100644
> --- a/testcases/kernel/firmware/fw_load/fw_load02.c
> +++ b/testcases/kernel/firmware/fw_load/fw_load02.c
> @@ -90,4 +90,6 @@ static struct tst_test test = {
>  		{FW_PATH, NULL, TST_SR_TCONF},
>  		{},
>  	},
> +	.skip_in_lockdown = 1,
> +	.skip_in_secureboot = 1,
>  };
> -- 
> 2.54.0
> 

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

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

* Re: [LTP] [PATCH v2] fw_load0[12]: Skip on Lockdown and Secure Boot
  2026-06-18 11:47   ` [LTP] [PATCH v2] " Avinesh Kumar via ltp
  2026-06-18 11:52     ` Andrea Cervesato via ltp
@ 2026-06-18 11:52     ` Andrea Cervesato via ltp
  2026-06-18 11:53     ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-18 11:52 UTC (permalink / raw)
  To: Avinesh Kumar; +Cc: ltp

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

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

* Re: [LTP] [PATCH v2] fw_load0[12]: Skip on Lockdown and Secure Boot
  2026-06-18 11:47   ` [LTP] [PATCH v2] " Avinesh Kumar via ltp
  2026-06-18 11:52     ` Andrea Cervesato via ltp
  2026-06-18 11:52     ` Andrea Cervesato via ltp
@ 2026-06-18 11:53     ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-06-18 11:53 UTC (permalink / raw)
  To: Avinesh Kumar; +Cc: ltp

Merged, Thanks!

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

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

end of thread, other threads:[~2026-06-18 11:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 20:03 [LTP] [PATCH] fw_load0[12]: Skip on Lockdown and Secure Boot Avinesh Kumar via ltp
2026-06-17 21:09 ` [LTP] " linuxtestproject.agent
2026-06-18 11:47   ` [LTP] [PATCH v2] " Avinesh Kumar via ltp
2026-06-18 11:52     ` Andrea Cervesato via ltp
2026-06-18 11:52     ` Andrea Cervesato via ltp
2026-06-18 11:53     ` Andrea Cervesato via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.