public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH v3 10/10] ima: Print /proc/cmdline and IMA kernel config
@ 2018-04-24 18:35 Petr Vorel
  2018-04-25  7:41 ` Michael Moese
  0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2018-04-24 18:35 UTC (permalink / raw)
  To: ltp

Useful for debugging

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Adding one more commit as it's useful to see config (due problems with
test order).

Petr
---
 .../kernel/security/integrity/ima/tests/ima_setup.sh    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh
index 56c4d5245..fa2b5337d 100644
--- a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh
@@ -64,6 +64,21 @@ mount_loop_device()
 	cd mntpoint
 }
 
+print_ima_config()
+{
+	local config="/boot/config-$(uname -r)"
+	local i
+
+	tst_res TINFO "/proc/cmdline: $(cat /proc/cmdline)"
+
+	if [ -r "$config" ]; then
+		tst_res TINFO "IMA kernel config"
+		for i in $(grep ^CONFIG_IMA $config); do
+			tst_res TINFO "$i"
+		done
+	fi
+}
+
 ima_setup()
 {
 	SECURITYFS="$(mount_helper securityfs $SYSFS/kernel/security)"
@@ -73,6 +88,8 @@ ima_setup()
 	ASCII_MEASUREMENTS="$IMA_DIR/ascii_runtime_measurements"
 	BINARY_MEASUREMENTS="$IMA_DIR/binary_runtime_measurements"
 
+	print_ima_config
+
 	if [ "$TST_NEEDS_DEVICE" = 1 ]; then
 		tst_res TINFO "\$TMPDIR is on tmpfs => run on loop device"
 		mount_loop_device
-- 
2.16.3


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

end of thread, other threads:[~2018-04-25 14:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-24 18:35 [LTP] [RFC PATCH v3 10/10] ima: Print /proc/cmdline and IMA kernel config Petr Vorel
2018-04-25  7:41 ` Michael Moese
2018-04-25 13:16   ` Petr Vorel
2018-04-25 13:40     ` Cyril Hrubis
2018-04-25 14:02       ` Petr Vorel
2018-04-25 14:07         ` Cyril Hrubis

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