android_kernel_sony_sdm845/arch/s390/kernel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Vasily Gorbik 4237e949fc s390/ftrace: save traced function caller
[ Upstream commit b4adfe55915d8363e244e42386d69567db1719b9 ]

A typical backtrace acquired from ftraced function currently looks like
the following (e.g. for "path_openat"):

arch_stack_walk+0x15c/0x2d8
stack_trace_save+0x50/0x68
stack_trace_call+0x15a/0x3b8
ftrace_graph_caller+0x0/0x1c
0x3e0007e3c98 <- ftraced function caller (should be do_filp_open+0x7c/0xe8)
do_open_execat+0x70/0x1b8
__do_execve_file.isra.0+0x7d8/0x860
__s390x_sys_execve+0x56/0x68
system_call+0xdc/0x2d8

Note random "0x3e0007e3c98" stack value as ftraced function caller. This
value causes either imprecise unwinder result or unwinding failure.
That "0x3e0007e3c98" comes from r14 of ftraced function stack frame, which
it haven't had a chance to initialize since the very first instruction
calls ftrace code ("ftrace_caller"). (ftraced function might never
save r14 as well). Nevertheless according to s390 ABI any function
is called with stack frame allocated for it and r14 contains return
address. "ftrace_caller" itself is called with "brasl %r0,ftrace_caller".
So, to fix this issue simply always save traced function caller onto
ftraced function stack frame.

Reported-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-11 09:22:19 +02:00
..
vdso32 s390/kasan: avoid vdso instrumentation 2019-11-25 09:53:43 +01:00
vdso64 s390/kasan: avoid vdso instrumentation 2019-11-25 09:53:43 +01:00
.gitignore
als.c s390/als: print missing facilities on facility mismatch 2016-07-31 05:27:59 -04:00
alternative.c s390: add automatic detection of the spectre defense 2018-04-29 11:31:59 +02:00
asm-offsets.c s390/ftrace: use expoline for indirect branches 2018-05-25 16:12:57 +02:00
audit.c
audit.h
base.S s390/kernel: use expoline for indirect branches 2018-05-25 16:12:57 +02:00
cache.c s390/cpuinfo: show dynamic and static cpu mhz 2016-06-13 15:58:17 +02:00
compat_audit.c
compat_linux.c s390: fix handling of -1 in set{,fs}[gu]id16 syscalls 2018-02-22 15:43:52 +01:00
compat_linux.h s390: add support for vector extension 2014-10-09 09:14:13 +02:00
compat_ptrace.h
compat_signal.c s390/compat: correct restore of high gprs on signal return 2016-02-22 09:29:35 +01:00
compat_wrapper.c s390: wire up copy_file_range syscall 2016-01-19 12:14:02 +01:00
cpcmd.c s390: Use pr_warn instead of pr_warning 2016-03-07 13:12:04 +01:00
crash_dump.c s390/kdump: Fix memleak in nt_vmcoreinfo 2018-09-15 09:42:58 +02:00
debug.c s390: Use pr_warn instead of pr_warning 2016-03-07 13:12:04 +01:00
diag.c s390/diag: fix display of diagnose call statistics 2020-04-24 07:58:59 +02:00
dis.c s390/disassembler: don't hide instruction addresses 2020-01-04 13:39:54 +01:00
dumpstack.c s390/dumpstack: use pr_cont within show_stack and die 2016-10-24 10:26:14 +02:00
early.c s390/early: improve machine detection 2019-01-31 08:12:34 +01:00
ebcdic.c
entry.h s390/als: convert architecture level set code to C 2016-07-31 05:27:58 -04:00
entry.S s390: Correct register corruption in critical section cleanup 2018-07-11 16:26:43 +02:00
fpu.c s390/fpu: improve kernel_fpu_[begin|end] 2016-08-29 11:05:01 +02:00
ftrace.c ftrace: Add return address pointer to ftrace_ret_stack 2016-08-24 12:15:14 +02:00
head.S s390: clarify compressed image code path 2016-08-08 15:41:31 +02:00
head64.S s390/cpumf: Fix lpp detection 2016-03-08 10:38:06 +01:00
head_kdump.S s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
idle.c s390/idle: convert open coded idle time seqcount 2014-12-08 09:42:32 +01:00
ipl.c s390: add options to change branch prediction behaviour for the kernel 2018-04-29 11:31:59 +02:00
irq.c s390: remove indirect branch from do_softirq_own_stack 2018-05-22 16:57:57 +02:00
jump_label.c Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-09-03 15:46:07 -07:00
kprobes.c s390: migrate exception table users off module.h and onto extable.h 2016-09-20 14:26:38 +02:00
lgr.c
machine_kexec.c s390/kexec: fix crash on resize of reserved memory 2016-06-13 15:58:19 +02:00
Makefile s390: move spectre sysfs attribute code 2018-05-25 16:12:58 +02:00
mcount.S s390/ftrace: save traced function caller 2020-06-11 09:22:19 +02:00
module.c s390: correct module section names for expoline code revert 2018-04-29 11:32:00 +02:00
nmi.c s390/nmi: improve revalidation of fpu / vector registers 2016-08-29 11:05:03 +02:00
nospec-branch.c s390: extend expoline to BC instructions 2018-05-25 16:12:58 +02:00
nospec-sysfs.c s390: move spectre sysfs attribute code 2018-05-25 16:12:58 +02:00
os_info.c s390/dump: streamline oldmem copy functions 2015-11-27 09:24:12 +01:00
perf_cpum_cf.c s390/cpum_cf: Reject request for sampling in event initialization 2018-12-17 09:38:32 +01:00
perf_cpum_cf_events.c s390/cpum_cf: Export event names in sysfs 2013-12-16 14:37:50 +01:00
perf_cpum_sf.c s390/cpum_sf: Avoid SBD overflow condition in irq handler 2020-01-12 11:24:10 +01:00
perf_event.c s390/dumpstack: restore reliable indicator for call traces 2016-10-17 14:44:30 +02:00
pgm_check.S s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
process.c s390/runtime instrumentation: simplify task exit handling 2017-12-09 22:01:47 +01:00
processor.c s390/cpuinfo: fix wrong output when CPU0 is offline 2020-04-24 07:59:12 +02:00
ptrace.c s390/ptrace: Preserve previous registers for short regset write 2017-02-01 08:33:07 +01:00
reipl.S s390/kernel: use expoline for indirect branches 2018-05-25 16:12:57 +02:00
relocate_kernel.S s390: remove "64" suffix from a couple of files 2015-03-25 11:49:34 +01:00
runtime_instr.c s390/runtime instrumentation: simplify task exit handling 2017-12-09 22:01:47 +01:00
sclp.c s390/sclp: move uninitialized data to data section 2016-07-31 05:27:58 -04:00
setup.c s390/early: improve machine detection 2019-01-31 08:12:34 +01:00
signal.c s390: remove all usages of PSW_ADDR_AMODE 2016-01-19 12:14:02 +01:00
smp.c s390/smp: fix physical to logical CPU map for SMT 2020-01-12 11:24:19 +01:00
stacktrace.c s390/dumpstack: restore reliable indicator for call traces 2016-10-17 14:44:30 +02:00
suspend.c PCI: Include <linux/pci.h>, not <asm/pci.h> 2015-06-08 07:55:03 -05:00
swsusp.S s390/kernel: use expoline for indirect branches 2018-05-25 16:12:57 +02:00
sys_s390.c s390: remove 31 bit support 2015-03-25 11:49:33 +01:00
syscalls.S s390: fix compat system call table 2017-12-14 09:28:13 +01:00
sysinfo.c s390/fpu: improve kernel_fpu_[begin|end] 2016-08-29 11:05:01 +02:00
time.c s390/time: avoid races when updating tb_update_count 2016-08-29 11:04:58 +02:00
topology.c s390/topology: avoid firing events before kobjs are created 2019-10-17 13:42:02 -07:00
trace.c s390/diag: avoid lockdep recursion 2016-02-11 13:05:56 +01:00
traps.c s390: migrate exception table users off module.h and onto extable.h 2016-09-20 14:26:38 +02:00
uprobes.c s390/uprobes: implement arch_uretprobe_is_alive() 2018-04-29 11:32:03 +02:00
vdso.c vdso: make arch_setup_additional_pages wait for mmap_sem for write killable 2016-05-23 17:04:14 -07:00
vmlinux.lds.S s390: introduce execute-trampolines for branches 2018-04-29 11:31:59 +02:00
vtime.c s390: add missing declarations 2016-05-10 13:24:51 +02:00