Skip to content

Commit

Permalink
crypto/qat: fix crash with CCM null AAD pointer
Browse files Browse the repository at this point in the history
[ upstream commit e90ef1803bb34768d1446e756046020e8cbce4bc ]

This commit fixes a segfault, that occurs when NULL pointer
is being set to the AAD pointer field.

Fixes: a815a04 ("crypto/qat: support symmetric build op request")

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
  • Loading branch information
arekk67 authored and bluca committed Mar 18, 2024
1 parent 642fff5 commit a56f165
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,12 @@ enqueue_one_aead_job_gen1(struct qat_sym_session *ctx,
*(uint8_t *)&cipher_param->u.cipher_IV_array[0] =
q - ICP_QAT_HW_CCM_NONCE_OFFSET;

rte_memcpy((uint8_t *)aad->va +
ICP_QAT_HW_CCM_NONCE_OFFSET,
(uint8_t *)iv->va + ICP_QAT_HW_CCM_NONCE_OFFSET,
ctx->cipher_iv.length);
if (ctx->aad_len > 0) {
rte_memcpy((uint8_t *)aad->va +
ICP_QAT_HW_CCM_NONCE_OFFSET,
(uint8_t *)iv->va + ICP_QAT_HW_CCM_NONCE_OFFSET,
ctx->cipher_iv.length);
}
break;
default:
break;
Expand Down

0 comments on commit a56f165

Please sign in to comment.