[LTP] [PATCH] ima: rewrite ima_mmap auxiliary with TST_NO_DEFAULT_MAIN

Petr Vorel pvorel@suse.cz
Tue May 12 18:45:31 CEST 2026


Hi Li, all,

> Commit 7276e7c154 ("ima_violations.sh: ima_mmap.c: Replace sleep with
> checkpoints") called tst_reinit() inside the run() callback of a
> struct tst_test based binary. This is incorrect because the test
> framework has already initialized the IPC during setup, and calling
> tst_reinit() re-maps the shared memory to the parent shell's IPC
> region, corrupting the C binary's own test infrastructure.

> Fix this by converting ima_mmap to a TST_NO_DEFAULT_MAIN helper
> binary. In this mode there is no prior framework initialization, so
> tst_reinit() correctly attaches to the parent shell test's shared
> memory for checkpoint communication, following the same pattern used
> by other LTP helper binaries (e.g. execvp01_child).

> Fixes: 7276e7c154 ("ima_violations.sh: ima_mmap.c: Replace sleep with checkpoints")

Li, thanks for fixing the problem I introduced. It's nice to get from vacation
and see the work has been done :).

And using TST_NO_DEFAULT_MAIN is indeed the best way for these simple helpers.

Kind regards,
Petr


More information about the ltp mailing list