[dpdk-dev] [PATCH v2] eal/service: fix exit by resetting service lcores

Van Haaren, Harry harry.van.haaren at intel.com
Wed Mar 11 17:21:17 CET 2020


> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Wednesday, March 11, 2020 4:16 PM
> To: Van Haaren, Harry <harry.van.haaren at intel.com>
> Cc: dev <dev at dpdk.org>; Aaron Conole <aconole at redhat.com>; dpdk stable
> <stable at dpdk.org>
> Subject: Re: [PATCH v2] eal/service: fix exit by resetting service lcores
> 
> On Wed, Mar 11, 2020 at 3:39 PM Harry van Haaren
> <harry.van.haaren at intel.com> wrote:
> >
> > This commit releases all service cores from their role,
> > returning them to ROLE_RTE on rte_service_finalize().
> >
> > This may fix an issue relating to the service cores causing
> 
> You don't seem convinced.

Apologies - kept from v1 of commit message, should have removed "may" for v2.

Issue was that service cores can remain running while main thread
has freed service-core memory, later racy return of service lcore
then causes use-after-free.

This commit fixes it by
A) resetting all service cores to return
B) waiting for them to return
C) freeing memory

I am confident in the fix.


> > a race-condition on eal_cleanup(), where the service core
> > could still be executing while the main thread has already
> > free-d the service memory, leading to a segfault.
> >
> > Fixes: 21698354c832 ("service: introduce service cores concept")
> > Cc: stable at dpdk.org
> >
> > Reported-by: David Marchand <david.marchand at redhat.com>
> > Reported-by: Aaron Conole <aconole at redhat.com>
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
> > Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
> > Acked-by: Aaron Conole <aconole at redhat.com>
> 
> I am okay with merging this so that we stop getting random failures of the
> ut. I will let this patch on the ml and apply on Friday at worse.
> 
> Please take the time to reply to my question.
> Thanks.

Thanks, -Harry


More information about the dev mailing list