]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: x86/sha256-mb - fix panic due to unaligned access
authorAndrey Ryabinin <aryabinin@virtuozzo.com>
Mon, 16 Oct 2017 15:51:30 +0000 (18:51 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Nov 2017 13:35:34 +0000 (21:35 +0800)
commitc511c0418b6c7dadfb1b20f6b63e1882ca3a0917
tree340bac4bef4a1f3f132107acdac7fc61553b2bee
parent8a576c1973361998b15bcb185e115a7da77898ed
crypto: x86/sha256-mb - fix panic due to unaligned access

struct sha256_ctx_mgr allocated in sha256_mb_mod_init() via kzalloc()
and later passed in sha256_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
sha256_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: 52ea725d1325 ("crypto: sha256-mb - submit/flush routines for AVX2")
Reported-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: <stable@vger.kernel.org>
Acked-by: Tim Chen
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S