From 1b75fdbda01ceac2051e3d443c1db0d884d11bd5 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 28 Nov 2023 16:05:29 -0800 Subject: 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 Signed-off-by: Florin Coras Change-Id: Ie769dad0e86ab970de9929800d0a4131f846e70e --- src/vcl/ldp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/vcl/ldp.c') 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!"); -- cgit 1.2.3-korg