]> git.itanic.dy.fi Git - linux-stable/commit
crypto: x86/sha1-mb - fix panic due to unaligned access
authorAndrey Ryabinin <aryabinin@virtuozzo.com>
Mon, 16 Oct 2017 15:51:31 +0000 (18:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Nov 2017 14:53:18 +0000 (15:53 +0100)
commitca6c028e2fe40488b28e7776f99a5d06f454a4a4
tree215c0311f7013921eed0bfa3bf3e107e479776fb
parent58ed8a47e450310a673c20a10153d0c5cddfaa08
crypto: x86/sha1-mb - fix panic due to unaligned access

commit d041b557792c85677f17e08eee535eafbd6b9aa2 upstream.

struct sha1_ctx_mgr allocated in sha1_mb_mod_init() via kzalloc()
and later passed in sha1_mb_flusher_mgr_flush_avx2() function where
instructions vmovdqa used to access the struct. vmovdqa requires
16-bytes aligned argument, but nothing guarantees that struct
sha1_ctx_mgr will have that alignment. Unaligned vmovdqa will
generate GP fault.

Fix this by replacing vmovdqa with vmovdqu which doesn't have alignment
requirements.

Fixes: 2249cbb53ead ("crypto: sha-mb - SHA1 multibuffer submit and flush routines for AVX2")
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S