From: Eric Biggers Date: Thu, 10 Jan 2019 20:17:58 +0000 (-0800) Subject: crypto: tgr192 - fix unaligned memory access X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f990f7fb58ac8ac9a43316f09a48cff1a49dda42;p=linux.git crypto: tgr192 - fix unaligned memory access 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 Signed-off-by: Herbert Xu --- diff --git a/crypto/tgr192.c b/crypto/tgr192.c index 022d3dd76c3b2..f8e1d9f9938f5 100644 --- a/crypto/tgr192.c +++ b/crypto/tgr192.c @@ -25,8 +25,9 @@ #include #include #include -#include #include +#include +#include #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;