[LTP] [PATCH] ima_selinux: Fix requirements

Petr Vorel pvorel@suse.cz
Mon Dec 8 15:13:21 CET 2025


"measure func=CRITICAL_DATA label=selinux" in selinux.policy LTP example
policy is a subset of "measure func=CRITICAL_DATA" loaded by
ima_policy=critical_data kernel command line option.

Therefore ima_selinux.sh require only one of them, not both.

Reported-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Thanks Mimi!

Kind regards,
Petr

 testcases/kernel/security/integrity/ima/tests/ima_selinux.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh b/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh
index 1a0de21efd..e64a7739f9 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_selinux.sh
@@ -18,13 +18,12 @@ TST_SETUP="setup"
 TST_MIN_KVER="5.12"
 
 REQUIRED_POLICY_CONTENT='selinux.policy'
+REQUIRED_BUILTIN_POLICY='critical_data'
 
 setup()
 {
 	SELINUX_DIR=$(tst_get_selinux_dir)
 	[ "$SELINUX_DIR" ] || tst_brk TCONF "SELinux is not enabled"
-
-	require_ima_policy_cmdline "critical_data"
 }
 
 # Format of the measured SELinux state data.
-- 
2.51.0



More information about the ltp mailing list