Skip to content

Commit 8a840fa

Browse files
committed
ima_selinux.sh: Require ima_policy=critical_data kernel cmdline
Test requires not only func=CRITICAL_DATA IMA policy content but also ima_policy=critical_data kernel cmdline. Without cmdline no measures are done. https://ima-doc.readthedocs.io/en/latest/ima-policy.html#ima-policy-critical-data https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdd1ffe8a812 Link: https://lore.kernel.org/ltp/20250224105925.2865777-1-pvorel@suse.cz/ Fixes: 4944a63 ("IMA: Add test for SELinux measurement") Signed-off-by: Petr Vorel <pvorel@suse.cz>
1 parent b5b135c commit 8a840fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

testcases/kernel/security/integrity/ima/tests/ima_selinux.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# Author: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
66
#
77
# Verify measurement of SELinux policy hash and state.
8-
# Test requires example IMA policy loadable with LTP_IMA_LOAD_POLICY=1.
8+
# Test requires ima_policy=critical_data kernel command line and example IMA
9+
# policy loadable with LTP_IMA_LOAD_POLICY=1.
910
#
1011
# Relevant kernel commits:
1112
# * fdd1ffe8a812 ("selinux: include a consumer of the new IMA critical data hook")
@@ -22,6 +23,8 @@ setup()
2223
{
2324
SELINUX_DIR=$(tst_get_selinux_dir)
2425
[ "$SELINUX_DIR" ] || tst_brk TCONF "SELinux is not enabled"
26+
27+
require_ima_policy_cmdline "critical_data"
2528
}
2629

2730
# Format of the measured SELinux state data.

0 commit comments

Comments
 (0)