Re: [PATCH 1/2] lkdtm: Make lkdtm_do_action() return to avoid tail call optimization

From: Kees Cook
Date: Mon Jan 22 2024 - 21:19:15 EST


On Mon, 22 Jan 2024 16:49:34 -0800, Douglas Anderson wrote:
> The comments for lkdtm_do_action() explicitly call out that it
> shouldn't be inlined because we want it to show up in stack
> crawls. However, at least with some compilers / options it's still
> vanishing due to tail call optimization. Let's add a return value to
> the function to make it harder for the compiler to do tail call
> optimization here.
>
> [...]

Applied to for-next/hardening, thanks!

[1/2] lkdtm: Make lkdtm_do_action() return to avoid tail call optimization
https://git.kernel.org/kees/c/189a4edb774b
[2/2] lkdtm/bugs: Adjust lkdtm_HUNG_TASK() to avoid tail call optimization
https://git.kernel.org/kees/c/edb6538da3df

Take care,

--
Kees Cook