@@ -355,6 +355,7 @@ odp_crypto_operation(odp_crypto_op_params_t *params,
enum crypto_alg_err rc_auth = ODP_CRYPTO_ALG_ERR_NONE;
odp_crypto_generic_session_t *session;
odp_crypto_op_result_t local_result;
+ int ret;
session = (odp_crypto_generic_session_t *)(intptr_t)params->session;
@@ -367,8 +368,13 @@ odp_crypto_operation(odp_crypto_op_params_t *params,
if (params->pkt != params->out_pkt) {
if (odp_unlikely(ODP_PACKET_INVALID == params->out_pkt))
ODP_ABORT();
- _odp_packet_copy_to_packet(params->pkt, 0, params->out_pkt, 0,
- odp_packet_len(params->pkt));
+ ret = _odp_packet_copy_to_packet(params->pkt,
+ 0,
+ params->out_pkt,
+ 0,
+ odp_packet_len(params->pkt));
+ if (odp_unlikely(ret))
+ ODP_ABORT();
_odp_packet_copy_md_to_packet(params->pkt, params->out_pkt);
odp_packet_free(params->pkt);
params->pkt = ODP_PACKET_INVALID;
In _odp_packet_copy_to_packet copying of packet can fail, with check for enought room in the packet. That may happen due to allocation error or possible memory corruption. Just call ODP_ABORT here. https://bugs.linaro.org/show_bug.cgi?id=1054 CID 85004: Unchecked return value (CHECKED_RETURN) Calling "_odp_packet_copy_to_packet" without checking return value (as is done elsewhere 5 out of 6 times). Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- platform/linux-generic/odp_crypto.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)