crypto: ccm - move cbcmac input off the stack

Commit f15f05b0a5de ("crypto: ccm - switch to separate cbcmac driver")
refactored the CCM driver to allow separate implementations of the
underlying MAC to be provided by a platform. However, in doing so, it
moved some data from the linear region to the stack, which violates the
SG constraints when the stack is virtually mapped.

So move idata/odata back to the request ctx struct, of which we can
reasonably expect that it has been allocated using kmalloc() et al.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Fixes: f15f05b0a5de ("crypto: ccm - switch to separate cbcmac driver")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by Ard Biesheuvel and committed by Herbert Xu 3b30460c 89027579

+3 -2
+3 -2
crypto/ccm.c
··· 45 46 struct crypto_ccm_req_priv_ctx { 47 u8 odata[16]; 48 u8 auth_tag[16]; 49 u32 flags; 50 struct scatterlist src[3]; ··· 184 AHASH_REQUEST_ON_STACK(ahreq, ctx->mac); 185 unsigned int assoclen = req->assoclen; 186 struct scatterlist sg[3]; 187 - u8 odata[16]; 188 - u8 idata[16]; 189 int ilen, err; 190 191 /* format control data for input */
··· 45 46 struct crypto_ccm_req_priv_ctx { 47 u8 odata[16]; 48 + u8 idata[16]; 49 u8 auth_tag[16]; 50 u32 flags; 51 struct scatterlist src[3]; ··· 183 AHASH_REQUEST_ON_STACK(ahreq, ctx->mac); 184 unsigned int assoclen = req->assoclen; 185 struct scatterlist sg[3]; 186 + u8 *odata = pctx->odata; 187 + u8 *idata = pctx->idata; 188 int ilen, err; 189 190 /* format control data for input */