Netdev List
 help / color / mirror / Atom feed
From: "Li,Rongqing" <lirongqing@baidu.com>
To: Hangbin Liu <hangbin.liu@linux.dev>
Cc: Jiri Pirko <jiri@resnulli.us>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Hangbin Liu <liuhangbin@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 答复: [????] Re: [PATCH] team: fix promisc/allmulti leak in team_port_add error path
Date: Tue, 20 Oct 2026 06:45:45 +0000	[thread overview]
Message-ID: <bf6a5ad0e59f47f58e0e6f475ffffa2f@baidu.com> (raw)
In-Reply-To: <atbHq7a_YzR6VuTg@fedora>



> error path
> 
> Hi Rongqing,
> On Mon, Oct 19, 2026 at 04:31:22PM +0800, lirongqing wrote:
> > From: Li RongQing <lirongqing@baidu.com>
> >
> > team_port_add() increments the port's promiscuity and allmulti counts
> > before calling team_dev_type_check_change(). If the latter fails, the
> > error path does not undo these increments, leaving the port in
> > promiscuous and allmulti mode even though it was not successfully
> > added to the team.
> >
> > Undo both increments in err_set_dev_type, matching the cleanup
> > performed by team_port_del().
> >
> > Fixes: 43c2adb9df7d ("team: set slave to promisc if team is already in
> > promisc mode")
> > Signed-off-by: Li RongQing <lirongqing@baidu.com>
> > ---
> >  drivers/net/team/team_core.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/team/team_core.c
> > b/drivers/net/team/team_core.c index ca75f08..3b30063 100644
> > --- a/drivers/net/team/team_core.c
> > +++ b/drivers/net/team/team_core.c
> > @@ -1386,6 +1386,10 @@ static int team_port_add(struct team *team,
> struct net_device *port_dev,
> >  	return 0;
> >
> >  err_set_dev_type:
> > +	if (dev->flags & IFF_PROMISC)
> > +		dev_set_promiscuity(port_dev, -1);
> > +	if (dev->flags & IFF_ALLMULTI)
> > +		dev_set_allmulti(port_dev, -1);
> >  err_set_slave_allmulti:
> 
> I think we can remove the dev_set_promiscuity(port_dev, -1); in if (dev->flags
> & IFF_ALLMULTI) and move it under here.
> 

Reasonable, I will send V2, thanks 

[Li,Rongqing] 


> 
> Thanks
> Hangbin

      reply	other threads:[~2026-10-20  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  8:31 [PATCH] team: fix promisc/allmulti leak in team_port_add error path lirongqing
2026-10-19  8:38 ` netdev-bot+sinfo
2026-10-20  1:45 ` Hangbin Liu
2026-10-20  6:45   ` Li,Rongqing [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf6a5ad0e59f47f58e0e6f475ffffa2f@baidu.com \
    --to=lirongqing@baidu.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hangbin.liu@linux.dev \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox