[ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first

Ben Pfaff blp at ovn.org
Wed Jun 3 00:34:33 UTC 2020


This is not how RCU works in OVS.  Every thread is by default considered
active.  They rarely quiesce except implicitly inside poll_block().
Please read the large comment at the top of ovs-rcu.h.

Is your patch based on actual bugs that you have found, or is it just
some kind of precaution?  If it is the latter, then it is not needed.

On Tue, Jun 02, 2020 at 11:22:57PM +0000, Yanqin Wei wrote:
> Hi Ben,
> 
> If my understanding is correct, the writer could not be a rcu thread because it does not need report holding or not holding pointers.
> So old memory will be freed after all rcu thread report quiesce.
> 
> Best Regards,
> Wei Yanqin
> 
> > -----Original Message-----
> > From: Ben Pfaff <blp at ovn.org>
> > Sent: Wednesday, June 3, 2020 1:28 AM
> > To: Linhaifeng <haifeng.lin at huawei.com>
> > Cc: Yanqin Wei <Yanqin.Wei at arm.com>; dev at openvswitch.org; nd
> > <nd at arm.com>; Lilijun (Jerry) <jerry.lilijun at huawei.com>; chenchanghu
> > <chenchanghu at huawei.com>; Lichunhe <lichunhe at huawei.com>
> > Subject: Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first
> > 
> > On Tue, Jun 02, 2020 at 07:27:59AM +0000, Linhaifeng wrote:
> > > We should update rcu pointer first then use ovsrcu_postpone to free
> > > otherwise maybe cause use-after-free.
> > > e.g.,reader indicates momentary quiescent and access old pointer after
> > > writer postpone free old pointer and before setting new pointer.
> > >
> > > Signed-off-by: Linhaifeng <haifeng.lin at huawei.com>
> > 
> > I don't see how that's possible, since the writer hasn't quiesced.


More information about the dev mailing list