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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:02 +0000 (11:53 +0100)
commit17df190b6a337ad66d1df34bca201d83f72e1d99
treefba76b9fefa69bb350f33c54b1eb99f72634724d
parent6ed6e024e3bb58332af0840b2658bc4252978ea4
crypto: arm64/poly1305-neon - reorder PAC authentication with SP update

[ Upstream commit 519a0d7e495a6d3ce62594e485aea2a3a4a2ca0a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/crypto/poly1305-armv8.pl
arch/arm64/crypto/poly1305-core.S_shipped