mirror-linux/arch/s390/kernel
Jens Remus 489e96651d s390/stacktrace: Do not fallback to RA register
The logic to fallback to the return address (RA) register value in
the topmost frame when stack tracing using back chain is broken in
multiple ways:

When assuming the RA register 14 has not been saved yet one must assume
that a new user stack frame has not been allocated either.  Therefore
the back chain would not contain the stack pointer (SP) at entry, but
the caller's SP at its entry instead.

Therefore when falling back to the RA register 14 value it would also be
necessary to fallback to the SP register 15 value.  Otherwise an invalid
combination of RA register 14 and caller's SP at its entry (from the
back chain) is used.

In the topmost frame the back chain contains either the caller's SP at
its entry (before having allocated a new stack frame in the prologue),
the SP at entry (after having allocated a new stack frame), or an
uninitialized value (during static/dynamic stack allocation).  In both
cases where the back chain is valid either the caller or prologue must
have saved its respective RA to the respective frame.  Therefore, if the
RA obtained from the frame pointed to by the back chain is invalid, this
does not indicate that the IP in the topmost frame is still early in the
prologue and the RA has not been saved.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2025-12-14 11:03:58 +01:00
..
diag s390: Remove superfluous newlines from inline assemblies 2025-09-29 13:52:08 +02:00
syscalls s390 updates for 6.19 merge window 2025-12-02 16:37:00 -08:00
vdso s390/vdso: Get rid of -m64 flag handling 2025-11-25 15:28:08 +01:00
.gitignore
Makefile s390/vdso: Rename vdso64 to vdso 2025-11-25 15:28:07 +01:00
abs_lowcore.c s390/lowcore: Convert relocated lowcore alternative to machine feature 2025-03-04 17:18:05 +01:00
alternative.c s390/alternatives: Add debug functionality 2025-03-04 17:18:08 +01:00
asm-offsets.c ARM: 2025-12-05 17:01:20 -08:00
audit.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
cache.c
cert_store.c s390: Remove optional third argument of strscpy() if possible 2025-04-17 15:16:10 +02:00
cpacf.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
cpcmd.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
cpufeature.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
crash_dump.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
ctlreg.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
debug.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
dis.c s390/fault: Print unmodified PSW address on protection exception 2025-11-14 11:34:28 +01:00
dumpstack.c s390/fault: Print unmodified PSW address on protection exception 2025-11-14 11:34:28 +01:00
early.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
early_printk.c
ebcdic.c
entry.S ARM: 2025-12-05 17:01:20 -08:00
entry.h s390/traps: Change stack overflow message 2025-03-04 17:34:03 +01:00
facility.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
fpu.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
ftrace.c s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
ftrace.h
guarded_storage.c s390/cpufeature: Convert MACHINE_HAS_GS to cpu_has_gs() 2025-03-04 17:18:04 +01:00
head.S s390: Rename head64.S to head.S 2025-11-25 15:28:07 +01:00
hiperdispatch.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
idle.c
ima_arch.c
ipl.c s390/ipl: Clear SBP flag when bootprog is set 2025-12-14 11:03:57 +01:00
ipl_vmparm.c
irq.c s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
jump_label.c
kdebugfs.c
kexec_elf.c s390: kexec: initialize kexec_buf struct 2025-09-03 17:10:37 -07:00
kexec_image.c s390: kexec: initialize kexec_buf struct 2025-09-03 17:10:37 -07:00
kprobes.c s390/cpufeature: Convert MACHINE_HAS_SEQ_INSN to cpu_has_seq_insn() 2025-03-04 17:18:04 +01:00
lgr.c s390: kernel: convert timeouts to use secs_to_jiffies() 2025-01-12 20:21:01 -08:00
machine_kexec.c s390: Convert MACHINE_IS_[LPAR|VM|KVM], etc, machine_is_[lpar|vm|kvm]() 2025-03-04 17:18:07 +01:00
machine_kexec_file.c s390: kexec: initialize kexec_buf struct 2025-09-03 17:10:37 -07:00
machine_kexec_reloc.c
mcount.S s390/tracing: Enable HAVE_FTRACE_GRAPH_FUNC 2024-12-26 10:50:05 -05:00
module.c s390: Add stackprotector support 2025-11-24 11:45:21 +01:00
nmi.c s390/nmi: Annotate s390_handle_damage() with __noreturn 2025-11-06 14:17:28 +01:00
nospec-branch.c
nospec-sysfs.c
numa.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
os_info.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
perf_cpum_cf.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
perf_cpum_cf_events.c s390/cpumf: Adjust number of leading zeroes for z15 attributes 2025-04-30 11:32:20 +02:00
perf_cpum_sf.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
perf_event.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
perf_pai.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
perf_regs.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
process.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
processor.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
ptrace.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
reipl.S
relocate_kernel.S
rethook.c
rethook.h
runtime_instr.c
setup.c s390: Rename head64.S to head.S 2025-11-25 15:28:07 +01:00
signal.c s390/vdso: Rename vdso64 to vdso 2025-11-25 15:28:07 +01:00
skey.c s390: Remove superfluous newlines from inline assemblies 2025-09-29 13:52:08 +02:00
smp.c s390: Add stackprotector support 2025-11-24 11:45:21 +01:00
stackprotector.c s390: Add stackprotector support 2025-11-24 11:45:21 +01:00
stacktrace.c s390/stacktrace: Do not fallback to RA register 2025-12-14 11:03:58 +01:00
sthyi.c s390: Fix double word in comments 2025-11-06 14:17:27 +01:00
syscall.c s390/syscalls: Switch to generic system call table generation 2025-11-17 11:10:39 +01:00
sysinfo.c s390/sysinfo: Replace sprintf() with snprintf() for buffer safety 2025-10-21 10:17:29 +02:00
text_amode31.S s390/amode31: Use exrl instead of ex 2025-01-13 09:50:17 +01:00
time.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
topology.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
trace.c
traps.c s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
unwind_bc.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
uprobes.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
uv.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
vdso.c s390/vdso: Rename vdso64 to vdso 2025-11-25 15:28:07 +01:00
vmcore_info.c
vmlinux.lds.S s390 updates for 6.19 merge window 2025-12-02 16:37:00 -08:00
vtime.c
wti.c