[LTP] ftrace: Add common library for C implementation

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Mon Jun 8 11:01:48 CEST 2026


Hi Praveen,

On Mon, Jun 8 2026, Praveen K Pandey wrote:
> ftrace: Add common library for C implementation

--- [PATCH 2/5] ---

> +/*\
> + * [Description]
> + *
> + * Test for kernel panic while using userstacktrace with page fault events.

The [Description] header is deprecated and must not be used. Remove
the `[Description]` line and start directly with the test description
text. The same applies to ftrace_regression02.c.

--- [PATCH 4/5] ---

> +static void cleanup(void)
> +{
> +	stop_testing = 1;
> +	ftrace_cleanup();
> +}

If the test is interrupted (e.g. SIGTERM on timeout), cleanup() is
called while stress threads may still be running. Setting stop_testing
does not guarantee threads have exited before ftrace_cleanup() frees
tracing_path and debugfs_path. Threads accessing those globals after
free is a use-after-free.

The fix is to join all threads in cleanup() before calling
ftrace_cleanup(), for example by calling stop_stress_tests() here
(guarded by thread_count > 0).

Verdict: Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list