diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-01-10 07:11:39 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-01-18 07:00:31 -0500 |
commit | eec7d4593a0c922c2d12649a373825cfa65c17ea (patch) | |
tree | 958d548141b7c2e8a92996047d72ea8cb81d8359 | |
parent | 62c24708761aa41fcda5986170276b7aa2669798 (diff) |
crypto: arm64/crc32 - move literal data to .rodata section
Move CRC32 literal data 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/crc32-ce-core.S | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm64/crypto/crc32-ce-core.S b/arch/arm64/crypto/crc32-ce-core.S index 18f5a8442276..16ed3c7ebd37 100644 --- a/arch/arm64/crypto/crc32-ce-core.S +++ b/arch/arm64/crypto/crc32-ce-core.S | |||
@@ -50,7 +50,7 @@ | |||
50 | #include <linux/linkage.h> | 50 | #include <linux/linkage.h> |
51 | #include <asm/assembler.h> | 51 | #include <asm/assembler.h> |
52 | 52 | ||
53 | .text | 53 | .section ".rodata", "a" |
54 | .align 6 | 54 | .align 6 |
55 | .cpu generic+crypto+crc | 55 | .cpu generic+crypto+crc |
56 | 56 | ||
@@ -115,12 +115,13 @@ | |||
115 | * uint crc32_pmull_le(unsigned char const *buffer, | 115 | * uint crc32_pmull_le(unsigned char const *buffer, |
116 | * size_t len, uint crc32) | 116 | * size_t len, uint crc32) |
117 | */ | 117 | */ |
118 | .text | ||
118 | ENTRY(crc32_pmull_le) | 119 | ENTRY(crc32_pmull_le) |
119 | adr x3, .Lcrc32_constants | 120 | adr_l x3, .Lcrc32_constants |
120 | b 0f | 121 | b 0f |
121 | 122 | ||
122 | ENTRY(crc32c_pmull_le) | 123 | ENTRY(crc32c_pmull_le) |
123 | adr x3, .Lcrc32c_constants | 124 | adr_l x3, .Lcrc32c_constants |
124 | 125 | ||
125 | 0: bic LEN, LEN, #15 | 126 | 0: bic LEN, LEN, #15 |
126 | ld1 {v1.16b-v4.16b}, [BUF], #0x40 | 127 | ld1 {v1.16b-v4.16b}, [BUF], #0x40 |