* [LTP] [PATCH 1/1] ima_kexec.sh: Detect kexec --reuse-cmdline support
@ 2025-09-04 9:07 Petr Vorel
2025-09-11 8:52 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2025-09-04 9:07 UTC (permalink / raw)
To: ltp
For some arch support for --reuse-cmdline was added recently (i.e.
ppc64le in v2.0.27 in Aug 2023), therefore older supported systems does
not have it. Detect the support and skip if not available.
While at it log kexec version.
Reported-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi all,
a candidate for a release fix.
Tested on various kernel versions and archs.
Kind regards,
Petr
.../kernel/security/integrity/ima/tests/ima_kexec.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh b/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh
index 9093ba2d64..d6eb0829d8 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_kexec.sh
@@ -68,6 +68,13 @@ setup()
fi
tst_res TINFO "using kernel $IMA_KEXEC_IMAGE"
+
+ tst_res TINFO "$(kexec -v)"
+
+ REUSE_CMDLINE_SUPPORTED=
+ if kexec -h 2>&1 | grep -q reuse-cmdline; then
+ REUSE_CMDLINE_SUPPORTED=1
+ fi
}
kexec_failure_hint()
@@ -100,6 +107,10 @@ kexec_test()
kexec_cmd="$param=$cmdline"
if [ "$param" = '--reuse-cmdline' ]; then
+ if [ "$REUSE_CMDLINE_SUPPORTED" != 1 ]; then
+ tst_res TCONF "--reuse-cmdline not supported"
+ return
+ fi
cmdline="$(sed 's/BOOT_IMAGE=[^ ]* //' /proc/cmdline)"
kexec_cmd="$param"
fi
--
2.50.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH 1/1] ima_kexec.sh: Detect kexec --reuse-cmdline support
2025-09-04 9:07 [LTP] [PATCH 1/1] ima_kexec.sh: Detect kexec --reuse-cmdline support Petr Vorel
@ 2025-09-11 8:52 ` Cyril Hrubis
2025-09-11 10:47 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2025-09-11 8:52 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
Reviwed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH 1/1] ima_kexec.sh: Detect kexec --reuse-cmdline support
2025-09-11 8:52 ` Cyril Hrubis
@ 2025-09-11 10:47 ` Petr Vorel
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2025-09-11 10:47 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
thanks for your review, merged.
FYI this snipped in because test was originally tested only on x86_64.
Further improvements to load example policy via LTP_IMA_LOAD_POLICY=1
(aac97cca96) and b5b135c9d8 ("ima_kexec.sh: Detect kernel image from BOOT_IMAGE
from /proc/cmdline") helped to discover it.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-11 10:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 9:07 [LTP] [PATCH 1/1] ima_kexec.sh: Detect kexec --reuse-cmdline support Petr Vorel
2025-09-11 8:52 ` Cyril Hrubis
2025-09-11 10:47 ` Petr Vorel
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.