On Thu, May 30, 2019 at 10:50:39AM -0700, Eric Biggers wrote: > From: Eric Biggers <ebigg...@google.com> > > Changing ghash_mod_init() to be subsys_initcall made it start running > before the alignment fault handler has been installed on ARM. In kernel > builds where the keys in the ghash test vectors happened to be > misaligned in the kernel image, this exposed the longstanding bug that > ghash_setkey() is incorrectly casting the key buffer (which can have any > alignment) to be128 for passing to gf128mul_init_4k_lle(). > > Fix this by memcpy()ing the key to a temporary buffer. > > Don't fix it by setting an alignmask on the algorithm instead because > that would unnecessarily force alignment of the data too. > > Fixes: 2cdc6899a88e ("crypto: ghash - Add GHASH digest algorithm for GCM") > Reported-by: Peter Robinson <pbrobin...@gmail.com> > Cc: sta...@vger.kernel.org > Signed-off-by: Eric Biggers <ebigg...@google.com> > Tested-by: Peter Robinson <pbrobin...@gmail.com> > --- > crypto/ghash-generic.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-)
Patch applied. Thanks. -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt