]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.44/s390-crc32-vx-use-expoline-for-indirect-branches.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.44 / s390-crc32-vx-use-expoline-for-indirect-branches.patch
1 From foo@baz Wed May 23 19:38:57 CEST 2018
2 From: Martin Schwidefsky <schwidefsky@de.ibm.com>
3 Date: Wed, 23 May 2018 18:22:03 +0200
4 Subject: s390/crc32-vx: use expoline for indirect branches
5 To: stable@vger.kernel.org
6 Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
7 Message-ID: <1527092529-24383-4-git-send-email-schwidefsky@de.ibm.com>
8
9 From: Martin Schwidefsky <schwidefsky@de.ibm.com>
10
11 [ Upstream commit 467a3bf219cee12259182c5cb4821f88fd518a51 ]
12
13 The return from the crc32_le_vgfm_16/crc32c_le_vgfm_16 and the
14 crc32_be_vgfm_16 functions are done with "br %r14". These are indirect
15 branches as well and need to use execute trampolines for CONFIG_EXPOLINE=y.
16
17 Cc: stable@vger.kernel.org # 4.16
18 Fixes: f19fbd5ed6 ("s390: introduce execute-trampolines for branches")
19 Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
20 Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 arch/s390/crypto/crc32be-vx.S | 5 ++++-
24 arch/s390/crypto/crc32le-vx.S | 4 +++-
25 2 files changed, 7 insertions(+), 2 deletions(-)
26
27 --- a/arch/s390/crypto/crc32be-vx.S
28 +++ b/arch/s390/crypto/crc32be-vx.S
29 @@ -13,6 +13,7 @@
30 */
31
32 #include <linux/linkage.h>
33 +#include <asm/nospec-insn.h>
34 #include <asm/vx-insn.h>
35
36 /* Vector register range containing CRC-32 constants */
37 @@ -67,6 +68,8 @@
38
39 .previous
40
41 + GEN_BR_THUNK %r14
42 +
43 .text
44 /*
45 * The CRC-32 function(s) use these calling conventions:
46 @@ -203,6 +206,6 @@ ENTRY(crc32_be_vgfm_16)
47
48 .Ldone:
49 VLGVF %r2,%v2,3
50 - br %r14
51 + BR_EX %r14
52
53 .previous
54 --- a/arch/s390/crypto/crc32le-vx.S
55 +++ b/arch/s390/crypto/crc32le-vx.S
56 @@ -14,6 +14,7 @@
57 */
58
59 #include <linux/linkage.h>
60 +#include <asm/nospec-insn.h>
61 #include <asm/vx-insn.h>
62
63 /* Vector register range containing CRC-32 constants */
64 @@ -76,6 +77,7 @@
65
66 .previous
67
68 + GEN_BR_THUNK %r14
69
70 .text
71
72 @@ -264,6 +266,6 @@ crc32_le_vgfm_generic:
73
74 .Ldone:
75 VLGVF %r2,%v2,2
76 - br %r14
77 + BR_EX %r14
78
79 .previous