linux-stable/arch
Josh Poimboeuf efd9381d62 x86/entry/64: Fix unwind hints in register clearing code
[ Upstream commit 06a9750edc ]

The PUSH_AND_CLEAR_REGS macro zeroes each register immediately after
pushing it.  If an NMI or exception hits after a register is cleared,
but before the UNWIND_HINT_REGS annotation, the ORC unwinder will
wrongly think the previous value of the register was zero.  This can
confuse the unwinding process and cause it to exit early.

Because ORC is simpler than DWARF, there are a limited number of unwind
annotation states, so it's not possible to add an individual unwind hint
after each push/clear combination.  Instead, the register clearing
instructions need to be consolidated and moved to after the
UNWIND_HINT_REGS annotation.

Fixes: 3f01daecd5 ("x86/entry/64: Introduce the PUSH_AND_CLEAN_REGS macro")
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Jones <dsj@fb.com>
Cc: Jann Horn <jannh@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: https://lore.kernel.org/r/68fd3d0bc92ae2d62ff7879d15d3684217d51f08.1587808742.git.jpoimboe@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-20 08:17:08 +02:00
..
alpha
arc ARC: define __ALIGN_STR and __ALIGN symbols for ARC 2020-03-20 10:54:17 +01:00
arm ARM: dts: bcm283x: Disable dsi0 node 2020-05-02 17:24:41 +02:00
arm64 arm64: Delete the space separator in __emit_inst 2020-05-02 17:24:44 +02:00
blackfin
c6x
cris
frv
h8300
hexagon hexagon: work around compiler crash 2020-01-17 19:45:55 +01:00
ia64
m32r
m68k m68k: Call timer_interrupt() with interrupts disabled 2020-01-27 14:46:54 +01:00
metag
microblaze microblaze: Prevent the overflow of the start 2020-02-28 16:36:08 +01:00
mips MIPS: OCTEON: irq: Fix potential NULL pointer dereference 2020-04-24 08:00:37 +02:00
mn10300
nios2 nios2: ksyms: Add missing symbol exports 2020-01-27 14:46:24 +01:00
openrisc openrisc: Fix broken paths to arch/or32 2019-12-05 15:37:38 +01:00
parisc parisc: Fix compiler warnings in debug_core.c 2020-01-12 12:12:01 +01:00
powerpc powerpc/pci/of: Parse unassigned resources 2020-05-10 10:28:58 +02:00
s390 s390/ftrace: fix potential crashes when switching tracers 2020-05-10 10:29:01 +02:00
score
sh pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs 2020-02-28 16:36:02 +01:00
sparc sparc: Add .exit.data section. 2020-02-28 16:35:57 +01:00
tile
um um: Make GCOV depend on !KCOV 2019-12-05 15:37:49 +01:00
unicore32
x86 x86/entry/64: Fix unwind hints in register clearing code 2020-05-20 08:17:08 +02:00
xtensa xtensa: fix TLB sanity checker 2019-12-21 10:47:43 +01:00
.gitignore
Kconfig