android_kernel_xiaomi_sm8350/arch
Chen Zhongjin 2668aeac01 x86/unwind/orc: Unwind ftrace trampolines with correct ORC entry
commit fc2e426b1161761561624ebd43ce8c8d2fa058da upstream.

When meeting ftrace trampolines in ORC unwinding, unwinder uses address
of ftrace_{regs_}call address to find the ORC entry, which gets next frame at
sp+176.

If there is an IRQ hitting at sub $0xa8,%rsp, the next frame should be
sp+8 instead of 176. It makes unwinder skip correct frame and throw
warnings such as "wrong direction" or "can't access registers", etc,
depending on the content of the incorrect frame address.

By adding the base address ftrace_{regs_}caller with the offset
*ip - ops->trampoline*, we can get the correct address to find the ORC entry.

Also change "caller" to "tramp_addr" to make variable name conform to
its content.

[ mingo: Clarified the changelog a bit. ]

Fixes: 6be7fa3c74 ("ftrace, orc, x86: Handle ftrace dynamically allocated trampolines")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220819084334.244016-1-chenzhongjin@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-05 10:27:43 +02:00
..
alpha tty: the rest, stop using tty_schedule_flip() 2022-07-29 17:14:19 +02:00
arc ARC: entry: fix syscall_trace_exit argument 2022-04-27 13:50:49 +02:00
arm ARM: dts: qcom: pm8841: add required thermal-sensor-cells 2022-08-25 11:17:35 +02:00
arm64 crypto: arm64/gcm - Select AEAD for GHASH_ARM64_CE 2022-08-25 11:17:41 +02:00
c6x
csky perf: Protect perf_guest_cbs with RCU 2022-01-20 09:19:18 +01:00
h8300
hexagon
ia64 ia64, processor: fix -Wincompatible-pointer-types in ia64_get_irr() 2022-08-25 11:17:25 +02:00
m68k m68k: use fallback for random_get_entropy() instead of zero 2022-06-22 14:11:15 +02:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-15 14:18:08 +02:00
mips MIPS: tlbex: Explicitly compare _PAGE_NO_EXEC against 0 2022-08-25 11:18:39 +02:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 08:46:48 +02:00
nios2 nios2: add force_successful_syscall_return() 2022-08-25 11:18:28 +02:00
openrisc openrisc: start CPU timer early in boot 2022-06-14 18:11:28 +02:00
parisc parisc: Fix exception handler for fldw and fstw instructions 2022-09-05 10:27:38 +02:00
powerpc powerpc/64: Init jump labels before parse_early_param() 2022-08-25 11:18:38 +02:00
riscv RISC-V: Add fast call path of crash_kexec() 2022-08-25 11:18:37 +02:00
s390 kexec, KEYS, s390: Make use of built-in and secondary keyring for signature verification 2022-08-25 11:18:11 +02:00
sh
sparc sparc: use fallback for random_get_entropy() instead of zero 2022-06-22 14:11:15 +02:00
um um: add "noreboot" command line option for PANIC_TIMEOUT=-1 setups 2022-08-25 11:18:34 +02:00
unicore32
x86 x86/unwind/orc: Unwind ftrace trampolines with correct ORC entry 2022-09-05 10:27:43 +02:00
xtensa xtensa: Fix refcount leak bug in time.c 2022-06-29 08:58:48 +02:00
.gitignore
Kconfig locking/refcount: Consolidate implementations of refcount_t 2022-07-29 17:14:17 +02:00