Skip to content

Commit ff33c2e

Browse files
ardbiesheuvelherbertx
authored andcommitted
crypto: arm/crc32 - add kCFI annotations to asm routines
The crc32/crc32c implementations using the scalar CRC32 instructions are accessed via indirect calls, and so they must be annotated with type ids in order to execute correctly when kCFI is enabled. Cc: Kees Cook <keescook@chromium.org> Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Kees Cook <kees@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 3cbe18b commit ff33c2e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

arch/arm/crypto/crc32-ce-core.S

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
*/
4949

5050
#include <linux/linkage.h>
51+
#include <linux/cfi_types.h>
5152
#include <asm/assembler.h>
5253

5354
.text
@@ -123,11 +124,12 @@
123124
* uint crc32_pmull_le(unsigned char const *buffer,
124125
* size_t len, uint crc32)
125126
*/
126-
ENTRY(crc32_pmull_le)
127+
SYM_FUNC_START(crc32_pmull_le)
127128
adr r3, .Lcrc32_constants
128129
b 0f
130+
SYM_FUNC_END(crc32_pmull_le)
129131

130-
ENTRY(crc32c_pmull_le)
132+
SYM_FUNC_START(crc32c_pmull_le)
131133
adr r3, .Lcrc32c_constants
132134

133135
0: bic LEN, LEN, #15
@@ -236,8 +238,7 @@ fold_64:
236238
vmov r0, s5
237239

238240
bx lr
239-
ENDPROC(crc32_pmull_le)
240-
ENDPROC(crc32c_pmull_le)
241+
SYM_FUNC_END(crc32c_pmull_le)
241242

242243
.macro __crc32, c
243244
subs ip, r2, #8
@@ -296,11 +297,11 @@ ARM_BE8(rev16 r3, r3 )
296297
.endm
297298

298299
.align 5
299-
ENTRY(crc32_armv8_le)
300+
SYM_TYPED_FUNC_START(crc32_armv8_le)
300301
__crc32
301-
ENDPROC(crc32_armv8_le)
302+
SYM_FUNC_END(crc32_armv8_le)
302303

303304
.align 5
304-
ENTRY(crc32c_armv8_le)
305+
SYM_TYPED_FUNC_START(crc32c_armv8_le)
305306
__crc32 c
306-
ENDPROC(crc32c_armv8_le)
307+
SYM_FUNC_END(crc32c_armv8_le)

0 commit comments

Comments
 (0)