Re: [PATCH] fgraph: Still initialize idle shadow stacks when starting

From: Linus Walleij
Date: Thu Dec 12 2024 - 15:49:57 EST


On Wed, Dec 11, 2024 at 7:53 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> A bug was discovered where the idle shadow stacks were not initialized
> for offline CPUs when starting function graph tracer, and when they came
> online they were not traced due to the missing shadow stack. To fix
> this, the idle task shadow stack initialization was moved to using the
> CPU hotplug callbacks. But it removed the initialization when the
> function graph was enabled. The problem here is that the hotplug
> callbacks are called when the CPUs come online, but the idle shadow
> stack initialization only happens if function graph is currently
> active. This caused the online CPUs to not get their shadow stack
> initialized.
>
> The idle shadow stack initialization still needs to be done when the
> function graph is registered, as they will not be allocated if function
> graph is not registered.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 2c02f7375e65 ("fgraph: Use CPU hotplug mechanism to initialize idle shadow stacks")
> Reported-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/CACRpkdaTBrHwRbbrphVy-=SeDz6MSsXhTKypOtLrTQ+DgGAOcQ@xxxxxxxxxxxxxx/
> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>

Yep that solves my issue and I can go on debugging my boot!
Tested-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Thanks for patching this up so quickly Stephen, you're the best.

Yours,
Linus Walleij