lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iKKr87hr4gAyHeK_uw9pK2QPg4oAE_JXUu=WHc8o9D-JQ@mail.gmail.com>
Date:   Thu, 17 Nov 2022 17:12:32 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     Joel Fernandes <joel@...lfernandes.org>
Cc:     linux-kernel@...r.kernel.org, Cong Wang <xiyou.wangcong@...il.com>,
        David Ahern <dsahern@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Jakub Kicinski <kuba@...nel.org>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org,
        Paolo Abeni <pabeni@...hat.com>, rcu@...r.kernel.org,
        rostedt@...dmis.org, paulmck@...nel.org, fweisbec@...il.com
Subject: Re: [PATCH rcu/dev 2/3] net: Use call_rcu_flush() for in_dev_rcu_put

On Thu, Nov 17, 2022 at 4:52 PM Joel Fernandes <joel@...lfernandes.org> wrote:
>
> Hi Eric,
>
> On Thu, Nov 17, 2022 at 01:58:18PM -0800, Eric Dumazet wrote:
> > On Wed, Nov 16, 2022 at 7:16 PM Joel Fernandes (Google)
> > <joel@...lfernandes.org> wrote:
> > >
> > > In a networking test on ChromeOS, we find that using the new CONFIG_RCU_LAZY
> > > causes a networking test to fail in the teardown phase.
> > >
> > > The failure happens during: ip netns del <name>
> > >
> > > Using ftrace, I found the callbacks it was queuing which this series fixes. Use
> > > call_rcu_flush() to revert to the old behavior. With that, the test passes.
> > >
> > > Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
> > > ---
> > >  net/ipv4/devinet.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> > > index e8b9a9202fec..98b20f333e00 100644
> > > --- a/net/ipv4/devinet.c
> > > +++ b/net/ipv4/devinet.c
> > > @@ -328,7 +328,7 @@ static void inetdev_destroy(struct in_device *in_dev)
> > >         neigh_parms_release(&arp_tbl, in_dev->arp_parms);
> > >         arp_ifdown(dev);
> > >
> > > -       call_rcu(&in_dev->rcu_head, in_dev_rcu_put);
> > > +       call_rcu_flush(&in_dev->rcu_head, in_dev_rcu_put);
> > >  }
> >
> > For this one, I suspect the issue is about device refcount lingering ?
> >
> > I think we should release refcounts earlier (and only delegate the
> > freeing part after RCU grace period, which can be 'lazy' just fine)
> >
> > Something like:
>
> The below diff where you reduce refcount before RCU grace period, also makes the
> test pass.
>
> If you are Ok with it, I can roll it into a patch with your Author tag and my
> Tested-by. Let me know what you prefer?
>
> Also, looking through the patch, I don't see any issue. One thing is
> netdev_put() now happens before a grace period, instead of after. But I don't
> think that's an issue.

Normally the early netdev_put() is fine, because these netdev are
already fully RCU protected.

Sure, feel free to take this patch as is, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ