• Andrey Ryabinin's avatar
    crypto: x86/sha1-mb - fix panic due to unaligned access · d041b557
    Andrey Ryabinin authored
    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: 2249cbb5 ("crypto: sha-mb - SHA1 multibuffer submit and flush routines for AVX2")
    Signed-off-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    d041b557
sha1_mb_mgr_flush_avx2.S 8.23 KB