vcl: fix incorrect ldp worker in ldp_epoll_pwait() 87/38287/2
authorLiangxing Wang <liangxing.wang@arm.com>
Thu, 16 Feb 2023 09:31:01 +0000 (09:31 +0000)
committerFlorin Coras <florin.coras@gmail.com>
Thu, 16 Feb 2023 17:49:43 +0000 (17:49 +0000)
commit7c7231fc30d9da81bc1311966fe8b9d8720c1623
tree3c341d2e23961dc1b1bf82e12e01c7e8d8321ac7
parent2ddb2fdaaf1233248c236cbe3d617c90f7fae20e
vcl: fix incorrect ldp worker in ldp_epoll_pwait()

For some apps(e.g. wrk2) upon vpp hoststack, ldp_epoll_pwait()
is called. In this function, epoll fd was created on one thread,
but it is now used on another thread. The vcl worker index is still
invalid, so the fetched ldp worker is also invalid and can corrupt
some already allocated memory.

Just as the ldp_epoll_pwait_eventfd(), make sure the vcl worker is valid
before getting the ldp worker in ldp_epoll_pwait().

Type: fix

Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Change-Id: I2ec23a4b5d5b0879a06642ffd80f95e948af4274
src/vcl/ldp.c