crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned
authorNathan Huckleberry <nhuck@google.com>
Tue, 18 Oct 2022 23:04:12 +0000 (16:04 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Oct 2022 11:05:05 +0000 (19:05 +0800)
commit9f6035af06b526e678808d492fc0830aef6cfbd8
treeca4db3f191fc721dbad5d0f5f3f1b0925b21e735
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
crypto: x86/polyval - Fix crashes when keys are not 16-byte aligned

crypto_tfm::__crt_ctx is not guaranteed to be 16-byte aligned on x86-64.
This causes crashes due to movaps instructions in clmul_polyval_update.

Add logic to align polyval_tfm_ctx to 16 bytes.

Cc: <stable@vger.kernel.org>
Fixes: 34f7f6c30112 ("crypto: x86/polyval - Add PCLMULQDQ accelerated implementation of POLYVAL")
Reported-by: Bruno Goncalves <bgoncalv@redhat.com>
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/polyval-clmulni_glue.c