]> git.baikalelectronics.ru Git - kernel.git/commit
s390/purgatory: Fix crash with expoline enabled
authorPhilipp Rudo <prudo@linux.ibm.com>
Tue, 26 Jun 2018 10:24:30 +0000 (12:24 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 6 Jul 2018 06:47:48 +0000 (08:47 +0200)
commit9211e220d1009bb2ea80a66607d9ab63a59943e5
tree3d57429962224695fd11b89c0f49dce87d3b2015
parentbc325c6380c0ad9cc16a759b7739a59283aa0e5f
s390/purgatory: Fix crash with expoline enabled

When the kernel is built with CONFIG_EXPOLINE=y and a compiler with
indirect branch mitigation enabled the purgatory crashes. The reason for
that is that the macros defined for expoline are used in mem.S. These
macros define new sections (.text.__s390x_indirect_*) which are marked
executable. Due to the missing linker script those sections are linked to
address 0, just as the .text section. In combination with the entry point
also being at address 0 this causes the purgatory load code
(kernel/kexec_file.c: kexec_purgatory_setup_sechdrs) to update the entry
point twice. Thus the old kernel jumps to some 'random' address causing the
crash.

To fix this turn off expolines for the purgatory. There is no problem with
this in this case due to the fact that the purgatory only runs once and the
tlb is purged (diag 308) in the end.

Fixes: 94d5a4720e5e1 ("s390/kexec_file: Add purgatory")
Cc: <stable@vger.kernel.org> # 4.17
Signed-off-by: Philipp Rudo <prudo@linux.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/purgatory/Makefile