diff options
author | Eric Biggers <ebiggers@google.com> | 2019-01-10 12:17:58 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 14:46:13 +0100 |
commit | 478428c99780eae874e04d07a1ce32fa99a9a484 (patch) | |
tree | f69e2d6f413ac6e117135d1e93c2a3d584965749 | |
parent | bc757cbe47a3e4b8e83c0b471890eeb7a3cb986a (diff) | |
download | linux-stable-478428c99780eae874e04d07a1ce32fa99a9a484.tar.gz linux-stable-478428c99780eae874e04d07a1ce32fa99a9a484.tar.bz2 linux-stable-478428c99780eae874e04d07a1ce32fa99a9a484.zip |
crypto: tgr192 - fix unaligned memory access
[ Upstream commit f990f7fb58ac8ac9a43316f09a48cff1a49dda42 ]
Fix an unaligned memory access in tgr192_transform() by using the
unaligned access helpers.
Fixes: 06ace7a9bafe ("[CRYPTO] Use standard byte order macros wherever possible")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | crypto/tgr192.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/tgr192.c b/crypto/tgr192.c index 321bc6ff2a9d..904c8444aa0a 100644 --- a/crypto/tgr192.c +++ b/crypto/tgr192.c @@ -25,8 +25,9 @@ #include <linux/init.h> #include <linux/module.h> #include <linux/mm.h> -#include <asm/byteorder.h> #include <linux/types.h> +#include <asm/byteorder.h> +#include <asm/unaligned.h> #define TGR192_DIGEST_SIZE 24 #define TGR160_DIGEST_SIZE 20 @@ -468,10 +469,9 @@ static void tgr192_transform(struct tgr192_ctx *tctx, const u8 * data) u64 a, b, c, aa, bb, cc; u64 x[8]; int i; - const __le64 *ptr = (const __le64 *)data; for (i = 0; i < 8; i++) - x[i] = le64_to_cpu(ptr[i]); + x[i] = get_unaligned_le64(data + i * sizeof(__le64)); /* save */ a = aa = tctx->a; |