Re: [PATCH v4 7/8] sframe: Introduce in-kernel SFRAME_VALIDATION

From: Dylan Hatch

Date: Mon Apr 27 2026 - 03:07:36 EST


On Wed, Apr 22, 2026 at 7:11 AM Jens Remus <jremus@xxxxxxxxxxxxx> wrote:
>
> On 4/22/2026 12:51 AM, Dylan Hatch wrote:
> > Generalize the __safe* helpers to support a non-user-access code path.
> >
> > This requires arch-specific function address validation. This is because
> > arm64 vmlinux has an .rodata.text section which lies outside the bounds
> > of the normal .text. It contains code that is never executed by the
> > kernel mapping, but for which the toolchain nonetheless generates sframe
> > data, and needs to be considered valid for a PC lookup.
> >
> > This arch-specific address validation logic is only necessary to support
> > SFRAME_VALIDATION for the vmlinux .sframe, since these .rodata.text
> > functions would never be encountered during normal unwinding.
> >
> > Signed-off-by: Dylan Hatch <dylanbhatch@xxxxxxxxxx>
> > Suggested-by: Jens Remus <jremus@xxxxxxxxxxxxx>
>
> With the minor nit below fixed:
>
> Reviewed-by: Jens Remus <jremus@xxxxxxxxxxxxx>
>
> > ---
> > arch/Kconfig | 2 +-
> > arch/arm64/include/asm/sections.h | 1 +
> > arch/arm64/include/asm/unwind_sframe.h | 21 +++++++++++++++++++++
> > arch/arm64/kernel/vmlinux.lds.S | 2 ++
> > include/linux/sframe.h | 2 ++
> > kernel/unwind/sframe.c | 25 +++++++++++++++++++++++--
> > 6 files changed, 50 insertions(+), 3 deletions(-)
>
> > diff --git a/arch/Kconfig b/arch/Kconfig
> > @@ -503,7 +503,7 @@ config HAVE_UNWIND_USER_SFRAME
> >
> > config SFRAME_VALIDATION
> > bool "Enable .sframe section debugging"
> > - depends on HAVE_UNWIND_USER_SFRAME
> > + depends on SFRAME_LOOKUP
>
> depends on UNWIND_SFRAME__LOOKUP

Ah my bad. This mistake was masking similar issues with .init.text and
.exit.text as we had with .rodata.text. I'll send a new version
accounting for those versions as well.

>
> > depends on DYNAMIC_DEBUG
> > help
> > When adding an .sframe section for a task, validate the entire
>
> Regards,
> Jens
> --
> Jens Remus
> Linux on Z Development (D3303)
> jremus@xxxxxxxxxx / jremus@xxxxxxxxxxxxx
>
> IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
> IBM Data Privacy Statement: https://www.ibm.com/privacy/
>

Thanks,
Dylan