summaryrefslogtreecommitdiff
path: root/crypto/khazad.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-11-24 11:47:19 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-30 11:51:35 +0100
commitcb13663e387eda6ead1c9e5e80564c584c27f467 (patch)
tree324873776f0d274460afc31e9d5e6cc1d0443e36 /crypto/khazad.c
parentf5e56bcaa4129333f8ecd065d94ecae510aa1da2 (diff)
downloadlinux-crypto-cb13663e387eda6ead1c9e5e80564c584c27f467.tar.gz
linux-crypto-cb13663e387eda6ead1c9e5e80564c584c27f467.zip
crypto: ecdh - avoid unaligned accesses in ecdh_set_secret()
commit 8319c80ab523e5735c07bb0da3bae7a93997c61e upstream. ecdh_set_secret() casts a void* pointer to a const u64* in order to feed it into ecc_is_key_valid(). This is not generally permitted by the C standard, and leads to actual misalignment faults on ARMv6 cores. In some cases, these are fixed up in software, but this still leads to performance hits that are entirely avoidable. So let's copy the key into the ctx buffer first, which we will do anyway in the common case, and which guarantees correct alignment. Cc: <stable@vger.kernel.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto/khazad.c')
0 files changed, 0 insertions, 0 deletions