aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-11-28 16:05:29 -0800
committerDave Wallace <dwallacelf@gmail.com>2023-11-29 17:00:24 +0000
commit1b75fdbda01ceac2051e3d443c1db0d884d11bd5 (patch)
treeb514040c5e73798fd07172931d143880e959a88b /src/vcl
parent557b20c4eab7b7aefd281f28f7535c4ea22a2845 (diff)
vcl: fix init of ldp workers
LDP workers is used as vector but was initialized as a pool. There was no side effect but ASAN does not properly unpoison memory and this triggers false used-after-poison crashes. Type: fix Signed-off-by: Dmitry Valter <d-valter@yandex-team.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie769dad0e86ab970de9929800d0a4131f846e70e
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/ldp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c
index 0338ce65a21..369c480ba31 100644
--- a/src/vcl/ldp.c
+++ b/src/vcl/ldp.c
@@ -195,7 +195,7 @@ ldp_alloc_workers (void)
{
if (ldp->workers)
return;
- pool_alloc (ldp->workers, LDP_MAX_NWORKERS);
+ ldp->workers = vec_new (ldp_worker_ctx_t, LDP_MAX_NWORKERS);
}
static void
@@ -312,11 +312,9 @@ ldp_init (void)
}
ldp->vcl_needs_real_epoll = 0;
ldp_alloc_workers ();
- ldpw = ldp_worker_get_current ();
- pool_foreach (ldpw, ldp->workers) {
+ vec_foreach (ldpw, ldp->workers)
clib_memset (&ldpw->clib_time, 0, sizeof (ldpw->clib_time));
- }
LDBG (0, "LDP initialization: done!");