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]
Date:   Thu, 10 Mar 2022 08:44:44 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     Paolo Abeni <pabeni@...hat.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        netdev <netdev@...r.kernel.org>,
        jeffreyji <jeffreyji@...gle.com>,
        Brian Vazquez <brianvv@...gle.com>
Subject: Re: [PATCH v2 net-next] net: add per-cpu storage and net->core_stats

On Thu, Mar 10, 2022 at 1:26 AM Paolo Abeni <pabeni@...hat.com> wrote:
>
> Hello,
>
> On Wed, 2022-03-09 at 16:46 -0800, Eric Dumazet wrote:
> > @@ -10282,6 +10282,24 @@ void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
> >  }
> >  EXPORT_SYMBOL(netdev_stats_to_stats64);
> >
> > +struct net_device_core_stats *netdev_core_stats_alloc(struct net_device *dev)
> > +{
> > +     struct net_device_core_stats __percpu *p;
> > +
> > +     p = alloc_percpu_gfp(struct net_device_core_stats,
> > +                          GFP_ATOMIC | __GFP_NOWARN);
> > +
> > +     if (p && cmpxchg(&dev->core_stats, NULL, p))
> > +             free_percpu(p);
> > +
> > +     p = dev->core_stats;
>
> Don't we need a READ_ONCE() here? if the allocation fails (!p) there is
> no memory barrier.

I guess you are right, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ