Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eec7d459 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu
Browse files

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: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 62c24708
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
#include <linux/linkage.h>
#include <asm/assembler.h>

	.text
	.section	".rodata", "a"
	.align		6
	.cpu		generic+crypto+crc

@@ -115,12 +115,13 @@
	 * uint crc32_pmull_le(unsigned char const *buffer,
	 *                     size_t len, uint crc32)
	 */
	.text
ENTRY(crc32_pmull_le)
	adr		x3, .Lcrc32_constants
	adr_l		x3, .Lcrc32_constants
	b		0f

ENTRY(crc32c_pmull_le)
	adr		x3, .Lcrc32c_constants
	adr_l		x3, .Lcrc32c_constants

0:	bic		LEN, LEN, #15
	ld1		{v1.16b-v4.16b}, [BUF], #0x40