diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-04-22 19:14:03 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-08-13 17:20:47 +0000 |
commit | 0115d1b5116d24f80c9061ca9a18868e6a929554 (patch) | |
tree | 064be85f76c821d6a4082100f91bb16fba466ec1 /src/vcl/vppcom.c | |
parent | 2c801f7ffb7475e3dec11ef6aef28d0cb1142561 (diff) |
vcl: fix use-after-free
Make sure we disconnect from vlib prior to free-ing the last worker, as
we'll need to access it.
Type: fix
Change-Id: Id5bdd17f0f5efa1ce52021b4270eb4f1e95cc61d
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 38ab5672b599df8ef201ca6733c9b008c37fdfa3)
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r-- | src/vcl/vppcom.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 2c87dff6172..9bf009d7bfa 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -1103,12 +1103,13 @@ vppcom_app_destroy (void) /* *INDENT-OFF* */ pool_foreach (wrk, vcm->workers, ({ + if (pool_elts (vcm->workers) == 1) + vl_client_disconnect_from_vlib (); vcl_worker_cleanup (wrk, 0 /* notify vpp */ ); })); /* *INDENT-ON* */ vcl_elog_stop (vcm); - vl_client_disconnect_from_vlib (); /* * Free the heap and fix vcm |