linux-stable/arch
Heiko Carstens 4f18d869ff s390: fix stfle zero padding
The stfle inline assembly returns the number of double words written
(condition code 0) or the double words it would have written
(condition code 3), if the memory array it got as parameter would have
been large enough.

The current stfle implementation assumes that the array is always
large enough and clears those parts of the array that have not been
written to with a subsequent memset call.

If however the array is not large enough memset will get a negative
length parameter, which means that memset clears memory until it gets
an exception and the kernel crashes.

To fix this simply limit the maximum length. Move also the inline
assembly to an extra function to avoid clobbering of register 0, which
might happen because of the added min_t invocation together with code
instrumentation.

The bug was introduced with commit 14375bc4eb ("[S390] cleanup
facility list handling") but was rather harmless, since it would only
write to a rather large array. It became a potential problem with
commit 3ab121ab18 ("[S390] kernel: Add z/VM LGR detection"). Since
then it writes to an array with only four double words, while some
machines already deliver three double words. As soon as machines have
a facility bit within the fifth double a crash on IPL would happen.

Fixes: 14375bc4eb ("[S390] cleanup facility list handling")
Cc: <stable@vger.kernel.org> # v2.6.37+
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2019-06-19 17:54:27 +02:00
..
alpha treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
arc treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
arm SPDX fixes for 5.2-rc3, round 2 2019-06-02 10:22:38 -07:00
arm64 SPDX update for 5.2-rc3, round 1 2019-05-31 08:34:32 -07:00
c6x treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
csky treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
h8300 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
hexagon treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
ia64 SPDX update for 5.2-rc3, round 1 2019-05-31 08:34:32 -07:00
m68k treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
microblaze treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
mips Fixes for PPC and s390. 2019-06-02 10:19:39 -07:00
nds32 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
nios2 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
openrisc treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
parisc arch/parisc/configs/c8000_defconfig: remove obsoleted CONFIG_DEBUG_SLAB_LEAK 2019-06-01 15:51:31 -07:00
powerpc processor: remove spin_cpu_yield 2019-06-15 12:25:49 +02:00
riscv treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
s390 s390: fix stfle zero padding 2019-06-19 17:54:27 +02:00
sh treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 211 2019-05-30 11:29:53 -07:00
sparc treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
um treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
unicore32 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
x86 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-06-02 11:10:01 -07:00
xtensa treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
.gitignore
Kconfig Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-05-16 11:00:20 -07:00