test/ipsec: fix crash in session destroy
authorRuifeng Wang <ruifeng.wang@arm.com>
Fri, 20 Mar 2020 08:05:20 +0000 (16:05 +0800)
committerAkhil Goyal <akhil.goyal@oss.nxp.com>
Sun, 5 Apr 2020 16:26:04 +0000 (18:26 +0200)
commit40a49a89d7dc7c64e58260e0097dd0ae5f98e9c4
tree03c0928f681b91650420dc03505ba52030a4adff
parentdda27cb3c1b7de2062c273ad46e0dfefc9e6a80c
test/ipsec: fix crash in session destroy

Segfault was observed when running ipsec unit test:

 + TestCase [10] : test_ipsec_replay_inb_repeat_null_null_wrapper
                   succeeded
 + TestCase [11] : test_ipsec_replay_inb_inside_burst_null_null_wrapper
                   succeeded
 + TestCase [12] : test_ipsec_crypto_inb_burst_2sa_null_null_wrapper
                   succeeded
 + TestCase [13] : test_ipsec_crypto_inb_burst_2sa_4grp_null_null_wrapper
                   succeeded
Segmentation fault

Data corruption happens due to incorrect destroy of session. Security
session needs process different from crypto session.

Destroy corresponding sessions according to different security actions.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
app/test/test_ipsec.c