[PATCH v2 0/3] powerpc/ftrace: Fix livepatch module OOL ftrace corruption

Madhavan Srinivasan maddy at linux.ibm.com
Mon Sep 22 15:44:00 AEST 2025


On Fri, 12 Sep 2025 10:27:37 -0400, Joe Lawrence wrote:
> This patch series fixes a couple of bugs in the powerpc64 out-of-line
> (OOL) ftrace support for modules, and follows up with a patch to
> simplify the module .stubs allocation code. An analysis of the module
> stub area corruption that prompted this work can be found in the v1
> thread [1].
> 
> The first two patches fix bugs introduced by commit eec37961a56a
> ("powerpc64/ftrace: Move ftrace sequence out of line"). The first,
> suggested by Naveen, ensures that a NOP'd ftrace call site has its
> ftrace_ops record updated correctly. The second patch corrects a loop in
> setup_ftrace_ool_stubs() to ensure all required stubs are reserved, not
> just the first. Together, these bugs lead to potential corruption of the
> OOL ftrace stubs area for livepatch modules.
> 
> [...]

Applied to powerpc/next.

[1/3] powerpc/ftrace: ensure ftrace record ops are always set for NOPs
      https://git.kernel.org/powerpc/c/5337609a314828aa2474ac359db615f475c4a4d2
[2/3] powerpc64/modules: correctly iterate over stubs in setup_ftrace_ool_stubs
      https://git.kernel.org/powerpc/c/f6b4df37ebfeb47e50e27780500d2d06b4d211bd
[3/3] powerpc64/modules: replace stub allocation sentinel with an explicit counter
      https://git.kernel.org/powerpc/c/b137312fbf2dd1edc39acf7e8e6e8ac0a6ad72c0

Thanks


More information about the Linuxppc-dev mailing list