aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-01-10 07:11:41 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2018-01-18 07:00:32 -0500
commit17a0607019d56e136173600372a371c28a6c0076 (patch)
treebe2cb40bf60269e52c8084dc0d9512604923598c
parent325f562d8f4a2047c26705b9788ce38a099225ed (diff)
crypto: arm64/sha2-ce - move the round constant table to .rodata section
Move the SHA2 round constant table to the .rodata section where it is safe from being exploited by speculative execution. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--arch/arm64/crypto/sha2-ce-core.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm64/crypto/sha2-ce-core.S b/arch/arm64/crypto/sha2-ce-core.S
index 679c6c002f4f..4c3c89b812ce 100644
--- a/arch/arm64/crypto/sha2-ce-core.S
+++ b/arch/arm64/crypto/sha2-ce-core.S
@@ -53,6 +53,7 @@
53 /* 53 /*
54 * The SHA-256 round constants 54 * The SHA-256 round constants
55 */ 55 */
56 .section ".rodata", "a"
56 .align 4 57 .align 4
57.Lsha2_rcon: 58.Lsha2_rcon:
58 .word 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5 59 .word 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5
@@ -76,9 +77,10 @@
76 * void sha2_ce_transform(struct sha256_ce_state *sst, u8 const *src, 77 * void sha2_ce_transform(struct sha256_ce_state *sst, u8 const *src,
77 * int blocks) 78 * int blocks)
78 */ 79 */
80 .text
79ENTRY(sha2_ce_transform) 81ENTRY(sha2_ce_transform)
80 /* load round constants */ 82 /* load round constants */
81 adr x8, .Lsha2_rcon 83 adr_l x8, .Lsha2_rcon
82 ld1 { v0.4s- v3.4s}, [x8], #64 84 ld1 { v0.4s- v3.4s}, [x8], #64
83 ld1 { v4.4s- v7.4s}, [x8], #64 85 ld1 { v4.4s- v7.4s}, [x8], #64
84 ld1 { v8.4s-v11.4s}, [x8], #64 86 ld1 { v8.4s-v11.4s}, [x8], #64