Re: [Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-10-02 Thread Cong Wang
On Fri, Sep 28, 2018 at 9:47 PM Cong Wang wrote: > > Just FYI, the crash is fixed, but another RCU warning pops up after > my fix. So I am still debugging it, it is related to the kfree_rcu() in > tcf_chain_destroy(). Update: I tried very hard to make it working, the end result is ugly, as I

Re: [Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-09-28 Thread Cong Wang
On Fri, Sep 28, 2018 at 11:29 AM Cong Wang wrote: > > On Fri, Sep 28, 2018 at 11:11 AM Ido Schimmel wrote: > > I don't think this will work given the reference count already dropped > > to 0, which is why the template deletion function was invoked. I didn't > > test the patch, but I don't see

Re: [Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-09-28 Thread Cong Wang
On Fri, Sep 28, 2018 at 11:11 AM Ido Schimmel wrote: > I don't think this will work given the reference count already dropped > to 0, which is why the template deletion function was invoked. I didn't > test the patch, but I don't see what would prevent the chain from being > freed. Good catch!

Re: [Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-09-28 Thread Ido Schimmel
On Fri, Sep 28, 2018 at 10:56:47AM -0700, Cong Wang wrote: > On Fri, Sep 28, 2018 at 7:59 AM Ido Schimmel wrote: > > > > On Wed, Sep 19, 2018 at 04:37:29PM -0700, Cong Wang wrote: > > > From: Vlad Buslov > > > > > > From: Vlad Buslov > > > > > > Action API was changed to work with actions and

Re: [Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-09-28 Thread Cong Wang
On Fri, Sep 28, 2018 at 7:59 AM Ido Schimmel wrote: > > On Wed, Sep 19, 2018 at 04:37:29PM -0700, Cong Wang wrote: > > From: Vlad Buslov > > > > From: Vlad Buslov > > > > Action API was changed to work with actions and action_idr in concurrency > > safe manner, however tcf_del_walker() still

Re: [Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-09-28 Thread Ido Schimmel
On Fri, Sep 28, 2018 at 05:59:00PM +0300, Ido Schimmel wrote: > I'm getting a use-after-free when running tc_chains.sh selftest and I > believe it's caused by this patch. BTW, I can't reproduce the issue after reverting the patch.

Re: [Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-09-28 Thread Ido Schimmel
On Wed, Sep 19, 2018 at 04:37:29PM -0700, Cong Wang wrote: > From: Vlad Buslov > > From: Vlad Buslov > > Action API was changed to work with actions and action_idr in concurrency > safe manner, however tcf_del_walker() still uses actions without taking a > reference or idrinfo->lock first, and

[Patch net-next v3] net_sched: change tcf_del_walker() to take idrinfo->lock

2018-09-19 Thread Cong Wang
From: Vlad Buslov From: Vlad Buslov Action API was changed to work with actions and action_idr in concurrency safe manner, however tcf_del_walker() still uses actions without taking a reference or idrinfo->lock first, and deletes them directly, disregarding possible concurrent delete. Change