[PATCH 21.11] service: fix early move to inactive status

Kevin Traynor ktraynor at redhat.com
Tue Nov 1 15:53:19 CET 2022


On 26/10/2022 21:14, Erik Gabriel Carrillo wrote:
> [ upstream commit 329280c53e6d09002b67e4d052fe27a952bd19cf ]
> 
> Assume thread T2 is a service lcore that is in the middle of executing
> a service function.  Also, assume thread T1 concurrently calls
> rte_service_lcore_stop(), which will set the "service_active_on_lcore"
> state to false.  If thread T1 then calls rte_service_may_be_active(),
> it can return zero even though T2 is still running the service function.
> If T1 then proceeds to free data being used by T2, a crash can ensue.
> 
> Move the logic that clears the "service_active_on_lcore" state from the
> rte_service_lcore_stop() function to the service_runner_func() to
> ensure that we:
> - don't let the "service_active_on_lcore" state linger as 1
> - don't clear the state early
> 
> Fixes: 6550113be62d ("service: fix lingering active status")
> Acked-by: Harry van Haaren <harry.van.haaren at intel.com>
> 
> Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>
> ---
>   lib/eal/common/rte_service.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 

Thanks for rebasing, applied.



More information about the stable mailing list