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
This commit is contained in:
Florin Coras
2023-11-28 16:05:29 -08:00
committed by Dave Wallace
parent 557b20c4ea
commit 1b75fdbda0

View File

@@ -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!");