]> git.baikalelectronics.ru Git - kernel.git/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)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Nov 2017 13:35:35 +0000 (21:35 +0800)
commit01e700753bd4111b601c37e758719c4417a3731e
tree742eabbecc54216d4acb6f7ed0e06cb6cea622d9
parentc511c0418b6c7dadfb1b20f6b63e1882ca3a0917
crypto: x86/sha1-mb - fix panic due to unaligned access

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: 3a8823dfa908 ("crypto: sha-mb - SHA1 multibuffer submit and flush routines for AVX2")
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S