diff options
| author | Cristian Stoica <cristian.stoica@freescale.com> | 2014-08-14 06:51:57 -0400 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-08-25 08:34:06 -0400 |
| commit | 4451d494b1910bf7b7f8381a637d0fe6d2142467 (patch) | |
| tree | 271b6bcf0b8667e6fc370f91ffa04043b18a2c5e /drivers/crypto/caam | |
| parent | 307fd543f3d23f8f56850eca1b27b1be2fe71017 (diff) | |
crypto: caam - fix addressing of struct member
buf_0 and buf_1 in caam_hash_state are not next to each other.
Accessing buf_1 is incorrect from &buf_0 with an offset of only
size_of(buf_0). The same issue is also with buflen_0 and buflen_1
Cc: <stable@vger.kernel.org> # 3.13+
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam')
| -rw-r--r-- | drivers/crypto/caam/caamhash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 061f3fbd9c79..f347ab7eea95 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c | |||
| @@ -1417,9 +1417,9 @@ static int ahash_update_first(struct ahash_request *req) | |||
| 1417 | struct device *jrdev = ctx->jrdev; | 1417 | struct device *jrdev = ctx->jrdev; |
| 1418 | gfp_t flags = (req->base.flags & (CRYPTO_TFM_REQ_MAY_BACKLOG | | 1418 | gfp_t flags = (req->base.flags & (CRYPTO_TFM_REQ_MAY_BACKLOG | |
| 1419 | CRYPTO_TFM_REQ_MAY_SLEEP)) ? GFP_KERNEL : GFP_ATOMIC; | 1419 | CRYPTO_TFM_REQ_MAY_SLEEP)) ? GFP_KERNEL : GFP_ATOMIC; |
| 1420 | u8 *next_buf = state->buf_0 + state->current_buf * | 1420 | u8 *next_buf = state->current_buf ? state->buf_1 : state->buf_0; |
| 1421 | CAAM_MAX_HASH_BLOCK_SIZE; | 1421 | int *next_buflen = state->current_buf ? |
| 1422 | int *next_buflen = &state->buflen_0 + state->current_buf; | 1422 | &state->buflen_1 : &state->buflen_0; |
| 1423 | int to_hash; | 1423 | int to_hash; |
| 1424 | u32 *sh_desc = ctx->sh_desc_update_first, *desc; | 1424 | u32 *sh_desc = ctx->sh_desc_update_first, *desc; |
| 1425 | dma_addr_t ptr = ctx->sh_desc_update_first_dma; | 1425 | dma_addr_t ptr = ctx->sh_desc_update_first_dma; |
