[LTP] [PATCH] lib: lockdown: Report lockdown as disabled on missing sysfs

Cyril Hrubis chrubis@suse.cz
Wed Sep 20 17:44:47 CEST 2023


We currently report -1 when secure boot sysfs file is not present which
is later interpreted as secure boot enabled. This causes regression in
*_module sycall tests executed on systems when secureboot is not
compiled-in or supported at all.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 lib/tst_lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_lockdown.c b/lib/tst_lockdown.c
index 38d830886..7613092ec 100644
--- a/lib/tst_lockdown.c
+++ b/lib/tst_lockdown.c
@@ -29,7 +29,7 @@ int tst_secureboot_enabled(void)
 
 	if (access(SECUREBOOT_VAR, F_OK)) {
 		tst_res(TINFO, "SecureBoot sysfs file not available");
-		return -1;
+		return 0;
 	}
 
 	fd = open(SECUREBOOT_VAR, O_RDONLY);
-- 
2.41.0



More information about the ltp mailing list