diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-01-10 07:11:38 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-01-18 07:00:30 -0500 |
commit | 62c24708761aa41fcda5986170276b7aa2669798 (patch) | |
tree | 358fad6790d4f4f85d1dc5f9612217a498a2dd80 | |
parent | 96a74f7bdc9c1326a06b69797725a285e9282cb3 (diff) |
crypto: arm64/aes-neon - move literal data to .rodata section
Move the S-boxes and some other literals 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/aes-neon.S | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm64/crypto/aes-neon.S b/arch/arm64/crypto/aes-neon.S index f1e3aa2732f9..1c7b45b7268e 100644 --- a/arch/arm64/crypto/aes-neon.S +++ b/arch/arm64/crypto/aes-neon.S | |||
@@ -32,10 +32,10 @@ | |||
32 | 32 | ||
33 | /* preload the entire Sbox */ | 33 | /* preload the entire Sbox */ |
34 | .macro prepare, sbox, shiftrows, temp | 34 | .macro prepare, sbox, shiftrows, temp |
35 | adr \temp, \sbox | ||
36 | movi v12.16b, #0x1b | 35 | movi v12.16b, #0x1b |
37 | ldr q13, \shiftrows | 36 | ldr_l q13, \shiftrows, \temp |
38 | ldr q14, .Lror32by8 | 37 | ldr_l q14, .Lror32by8, \temp |
38 | adr_l \temp, \sbox | ||
39 | ld1 {v16.16b-v19.16b}, [\temp], #64 | 39 | ld1 {v16.16b-v19.16b}, [\temp], #64 |
40 | ld1 {v20.16b-v23.16b}, [\temp], #64 | 40 | ld1 {v20.16b-v23.16b}, [\temp], #64 |
41 | ld1 {v24.16b-v27.16b}, [\temp], #64 | 41 | ld1 {v24.16b-v27.16b}, [\temp], #64 |
@@ -272,7 +272,7 @@ | |||
272 | 272 | ||
273 | #include "aes-modes.S" | 273 | #include "aes-modes.S" |
274 | 274 | ||
275 | .text | 275 | .section ".rodata", "a" |
276 | .align 6 | 276 | .align 6 |
277 | .LForward_Sbox: | 277 | .LForward_Sbox: |
278 | .byte 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5 | 278 | .byte 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5 |