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:08:45 +0000 (09:08 -0700)
commitcc78d091bd92300de98b1b372da7d5ee9dcd8e63
tree97348706a45ed2b2a87ee02c7ce40530da50863e
parent8c5156ad2da4493e6402bf7335d044445dca8c00
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