Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF33CC28CBC for ; Wed, 6 May 2020 05:26:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA750206E6 for ; Wed, 6 May 2020 05:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726776AbgEFF0G (ORCPT ); Wed, 6 May 2020 01:26:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:38626 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbgEFF0G (ORCPT ); Wed, 6 May 2020 01:26:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A0795AE2D; Wed, 6 May 2020 05:26:07 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 59B30602B9; Wed, 6 May 2020 07:26:04 +0200 (CEST) Date: Wed, 6 May 2020 07:26:04 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Cong Wang , syzbot , syzbot+c2fb6f9ddcea95ba49b5@syzkaller.appspotmail.com, Jarod Wilson , Josh Poimboeuf , Jay Vosburgh , Jann Horn Subject: Re: [Patch net] net: fix a potential recursive NETDEV_FEAT_CHANGE Message-ID: <20200506052604.GM5989@lion.mk-sys.cz> References: <20200505215819.1997-1-xiyou.wangcong@gmail.com> <20200505222748.GQ8237@lion.mk-sys.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, May 05, 2020 at 03:35:27PM -0700, Cong Wang wrote: > On Tue, May 5, 2020 at 3:27 PM Michal Kubecek 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. Michal > When we change features from top down, ->ndo_fix_features() > does the work, in bonding case, it is bond_fix_features(). > I see no netlink notification either in bond_compute_features() > or bond_fix_features(). > > Thanks.