lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260127153331.2902504-4-jremus@linux.ibm.com>
Date: Tue, 27 Jan 2026 16:33:29 +0100
From: Jens Remus <jremus@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
        linux-s390@...r.kernel.org, bpf@...r.kernel.org, x86@...nel.org,
        Steven Rostedt <rostedt@...nel.org>
Cc: Jens Remus <jremus@...ux.ibm.com>, Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Ilya Leoshkevich <iii@...ux.ibm.com>,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andrii Nakryiko <andrii@...nel.org>,
        Indu Bhagat <indu.bhagat@...cle.com>,
        "Jose E. Marchesi" <jemarch@....org>,
        Beau Belgrave <beaub@...ux.microsoft.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Florian Weimer <fweimer@...hat.com>, Kees Cook <kees@...nel.org>,
        "Carlos O'Donell" <codonell@...hat.com>, Sam James <sam@...too.org>,
        Dylan Hatch <dylanbhatch@...gle.com>
Subject: [RFC PATCH v1 3/5] s390/vdso: Annotate __kernel_[rt_]sigreturn as signal frames

The GNU assembler supports CFI directive .cfi_signal_frame with
binutils 2.17+.  Use it to annotate the vDSO functions
__kernel_sigreturn() and __kernel_rt_sigreturn() as signal
frames.

This enables generation of SFrame stack trace information for the
vDSO to likewise annotate these functions for use in stack tracers,
such as the kernel unwind user sframe.

Signed-off-by: Jens Remus <jremus@...ux.ibm.com>
---
 arch/s390/include/asm/dwarf.h             |  3 +++
 arch/s390/kernel/vdso/vdso_user_wrapper.S | 15 +++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/s390/include/asm/dwarf.h b/arch/s390/include/asm/dwarf.h
index 2f148b15fd7d..e5663d6b11db 100644
--- a/arch/s390/include/asm/dwarf.h
+++ b/arch/s390/include/asm/dwarf.h
@@ -35,6 +35,8 @@
 #define CFI_VAL_OFFSET		nocfi
 #endif
 
+#define CFI_SIGNAL_FRAME	.cfi_signal_frame
+
 #else /* !BUILD_VDSO */
 
 /*
@@ -49,6 +51,7 @@
 #define CFI_RESTORE		nocfi
 #define CFI_REL_OFFSET		nocfi
 #define CFI_VAL_OFFSET		nocfi
+#define CFI_SIGNAL_FRAME	nocfi
 
 #endif /* !BUILD_VDSO */
 
diff --git a/arch/s390/kernel/vdso/vdso_user_wrapper.S b/arch/s390/kernel/vdso/vdso_user_wrapper.S
index aa06c85bcbd3..757503929ab0 100644
--- a/arch/s390/kernel/vdso/vdso_user_wrapper.S
+++ b/arch/s390/kernel/vdso/vdso_user_wrapper.S
@@ -47,6 +47,17 @@ SYM_FUNC_START(__kernel_\func)
 SYM_FUNC_END(__kernel_\func)
 .endm
 
+.macro vdso_syscall_sf func,syscall
+SYM_FUNC_START(__kernel_\func)
+	CFI_STARTPROC simple
+	CFI_SIGNAL_FRAME
+	svc	\syscall
+	/* Trap, if syscall returns, which shouldn't happen */
+	.insn e,0x0000
+	CFI_ENDPROC
+SYM_FUNC_END(__kernel_\func)
+.endm
+
 vdso_syscall restart_syscall,__NR_restart_syscall
-vdso_syscall sigreturn,__NR_sigreturn
-vdso_syscall rt_sigreturn,__NR_rt_sigreturn
+vdso_syscall_sf sigreturn,__NR_sigreturn
+vdso_syscall_sf rt_sigreturn,__NR_rt_sigreturn
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ