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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 04 Jan 2022 17:23:51 +0100
From:   Johannes Berg <johannes@...solutions.net>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 11/13] netlink: add net device refcount tracker
 to struct ethnl_req_info

On Tue, 2022-01-04 at 08:22 -0800, Eric Dumazet wrote:
> On Tue, Jan 4, 2022 at 8:07 AM Johannes Berg <johannes@...solutions.net> wrote:
> > 
> > Hi Eric,
> > 
> > > > > @@ -624,6 +625,7 @@ static void ethnl_default_notify(struct net_device *dev, unsigned int cmd,
> > > > >       }
> > > > > 
> > > > >       req_info->dev = dev;
> > > > > +     netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);
> > > > >       req_info->flags |= ETHTOOL_FLAG_COMPACT_BITSETS;
> > > > > 
> > > > 
> > > > I may have missed a follow-up patch (did a search on netdev now, but
> > > > ...), but I'm hitting warnings from this and I'm not sure it's right?
> > > > 
> > > > This req_info is just allocated briefly and freed again, and I'm not
> > > > even sure there's a dev_get/dev_put involved here, I didn't see any?
> > > 
> > > We had a fix.
> > > 
> > > commit 34ac17ecbf575eb079094d44f1bd30c66897aa21
> > > Author: Eric Dumazet <edumazet@...gle.com>
> > > Date:   Tue Dec 14 00:42:30 2021 -0800
> > > 
> > >     ethtool: use ethnl_parse_header_dev_put()
> > > 
> > 
> > Hmm. I have this in my tree, and I don't think it affected
> > ethnl_default_notify() anyway?
> 
> Strange, syzbot have not reported anything there.

:)

Not sure - I'm hitting it in one of the wireless bridging tests.

> 
> ethnl_parse_header_dev_get() needs to take a ref, but
> indeed ethnl_default_notify() does its own allocation/freeing.

Right.

> diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
> index ea23659fab28..5fe8f4ae2ceb 100644
> --- a/net/ethtool/netlink.c
> +++ b/net/ethtool/netlink.c
> @@ -627,7 +627,6 @@ static void ethnl_default_notify(struct net_device
> *dev, unsigned int cmd,
>         }
> 
>         req_info->dev = dev;
> -       netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);

So I had already tested both this and explicitly doing
netdev_tracker_free() when req_info is freed, both work fine.

Tested-by: Johannes Berg <johannes@...solutions.net>

Just wasn't sure it was correct or I was missing something. :)

johannes

Powered by blists - more mailing lists