crypto: arm64/poly1305-neon - reorder PAC authentication with SP update
authorArd Biesheuvel <ardb@kernel.org>
Mon, 26 Oct 2020 23:00:27 +0000 (00:00 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Nov 2020 03:29:11 +0000 (14:29 +1100)
commit519a0d7e495a6d3ce62594e485aea2a3a4a2ca0a
treed386150e9c60b6cee7b6f506cae01da5e38207c4
parent92eb6c3060ebe3adf381fd9899451c5b047bb14d
crypto: arm64/poly1305-neon - reorder PAC authentication with SP update

PAC pointer authentication signs the return address against the value
of the stack pointer, to prevent stack overrun exploits from corrupting
the control flow. However, this requires that the AUTIASP is issued with
SP holding the same value as it held when the PAC value was generated.
The Poly1305 NEON code got this wrong, resulting in crashes on PAC
capable hardware.

Fixes: f569ca164751 ("crypto: arm64/poly1305 - incorporate OpenSSL/CRYPTOGAMS ...")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/poly1305-armv8.pl
arch/arm64/crypto/poly1305-core.S_shipped