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

Jens Remus jremus at linux.ibm.com
Wed Apr 22 07:11:12 PDT 2026


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 at google.com>
> Suggested-by: Jens Remus <jremus at linux.ibm.com>

With the minor nit below fixed:

Reviewed-by: Jens Remus <jremus at linux.ibm.com>

> ---
>  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

>  	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 at de.ibm.com / jremus at linux.ibm.com

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/




More information about the linux-arm-kernel mailing list