3.16.70-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Biggers <ebigg...@google.com>

commit f990f7fb58ac8ac9a43316f09a48cff1a49dda42 upstream.

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 <ebigg...@google.com>
Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
 crypto/tgr192.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- 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 tgr1
        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;

Reply via email to