Skip to content

Commit

Permalink
app/crypto-perf: fix AAD template copy overrun
Browse files Browse the repository at this point in the history
[ upstream commit 49c19c9 ]

This patch fixes a possible buffer overrun problem in crypto perf test.
Previously when user configured AAD size is over 12 bytes the copy
of template AAD will cause a buffer overrun.
The problem is fixed by only copy up to 12 bytes of AAD template.

Fixes: 8a5b494 ("app/test-crypto-perf: add AEAD parameters")

Signed-off-by: Przemyslaw Zegan <przemyslawx.zegan@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  • Loading branch information
pzeganx authored and cpaelzer committed Nov 30, 2021
1 parent 2ff1b96 commit 037204d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/test-crypto-perf/cperf_test_vectors.c
Expand Up @@ -553,6 +553,10 @@ cperf_test_vector_get_dummy(struct cperf_options *options)
rte_free(t_vec);
return NULL;
}

if (options->aead_aad_sz > sizeof(aad))
options->aead_aad_sz = sizeof(aad);

memcpy(t_vec->aad.data, aad, options->aead_aad_sz);
t_vec->aad.phys_addr = rte_malloc_virt2iova(t_vec->aad.data);
t_vec->aad.length = options->aead_aad_sz;
Expand Down

0 comments on commit 037204d

Please sign in to comment.