[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpWTW_O7WHx5-4BLXqiV3e-eYowGRv-aG-LRZmJwvdyt5A@mail.gmail.com>
Date: Wed, 6 May 2020 12:08:35 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
syzbot <syzbot+e73ceacfd8560cc8a3ca@...kaller.appspotmail.com>,
syzbot+c2fb6f9ddcea95ba49b5@...kaller.appspotmail.com,
Jarod Wilson <jarod@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jay Vosburgh <j.vosburgh@...il.com>,
Jann Horn <jannh@...gle.com>
Subject: Re: [Patch net] net: fix a potential recursive NETDEV_FEAT_CHANGE
On Tue, May 5, 2020 at 10:26 PM Michal Kubecek <mkubecek@...e.cz> wrote:
>
> On Tue, May 05, 2020 at 03:35:27PM -0700, Cong Wang wrote:
> > On Tue, May 5, 2020 at 3:27 PM Michal Kubecek <mkubecek@...e.cz> wrote:
> > > On Tue, May 05, 2020 at 02:58:19PM -0700, Cong Wang wrote:
> > > > diff --git a/net/core/dev.c b/net/core/dev.c
> > > > index 522288177bbd..ece50ae346c3 100644
> > > > --- a/net/core/dev.c
> > > > +++ b/net/core/dev.c
> > > > @@ -8907,7 +8907,7 @@ static void netdev_sync_lower_features(struct net_device *upper,
> > > > netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n",
> > > > &feature, lower->name);
> > > > lower->wanted_features &= ~feature;
> > > > - netdev_update_features(lower);
> > > > + __netdev_update_features(lower);
> > > >
> > > > if (unlikely(lower->features & feature))
> > > > netdev_WARN(upper, "failed to disable %pNF on %s!\n",
> > >
> > > Wouldn't this mean that when we disable LRO on a bond manually with
> > > "ethtool -K", LRO will be also disabled on its slaves but no netlink
> > > notification for them would be sent to userspace?
> >
> > What netlink notification are you talking about?
>
> There is ethtool notification sent by ethnl_netdev_event() and rtnetlink
> notification sent by rtnetlink_event(). Both are triggered by
> NETDEV_FEAT_CHANGE notifier so unless I missed something, when you
> suppress the notifier, there will be no netlink notifications to
> userspace.
Oh, interesting, why ethtool_notify() can't be called directly, for example,
in netdev_update_features()? To me, using a NETDEV_FEAT_CHANGE
event handler seems unnecessary for ethtool netlink.
BTW, as pointed out by Jay, actually we only need to skip
NETDEV_FEAT_CHANGE for failure case, so I will update my patch.
Thanks.
Powered by blists - more mailing lists