crypto: ccp - Don't assume export/import areas are aligned
authorTom Lendacky <thomas.lendacky@amd.com>
Tue, 2 Feb 2016 17:38:21 +0000 (11:38 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:12:44 +0000 (09:12 -0700)
commitf8b3400718a0ba3d445c0e7302d5b6ce2f60f2fa
tree6e17535c1661e2adc47402bceb15634808efa704
parentfafbde3a5949b7d84b5710e5f5a31d666d4715af
crypto: ccp - Don't assume export/import areas are aligned

commit b31dde2a5cb1bf764282abf934266b7193c2bc7c upstream.

Use a local variable for the exported and imported state so that
alignment is not an issue. On export, set a local variable from the
request context and then memcpy the contents of the local variable to
the export memory area. On import, memcpy the import memory area into
a local variable and then use the local variable to set the request
context.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccp/ccp-crypto-aes-cmac.c
drivers/crypto/ccp/ccp-crypto-sha.c