From 3e57d78a9ad65c6b2a9b68e7bb52b6902f574152 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Sat, 24 Feb 2018 20:51:53 -0600 Subject: Fix bug in dpdk_crypto_session_disposal() The expression to determine whether to delete a session from the disposal list only evaluates true if some, but not all, of the sessions in the list were freed. When all sessions in the list are freed, it evaluates false and the sessions are left in the list to be freed again later, which can result in a session pool element that was reallocated to a different SA being freed, breaking crypto for the newer SA. Add an 'else' that handles the case where all sessions were freed. Change-Id: I3ae54d5b3bfc3658bf406caa50646924baaae589 Signed-off-by: Matthew Smith --- src/plugins/dpdk/ipsec/ipsec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c index dbb069c9e2e..9be7b3bf6a0 100644 --- a/src/plugins/dpdk/ipsec/ipsec.c +++ b/src/plugins/dpdk/ipsec/ipsec.c @@ -467,6 +467,8 @@ dpdk_crypto_session_disposal (crypto_session_disposal_t * v, u64 ts) if (s < vec_end (v)) vec_delete (v, s - v, 0); + else + vec_reset_length (v); return 0; } -- cgit 1.2.3-korg