All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: lirongqing@baidu.com
Cc: jiri@resnulli.us, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	liuhangbin@gmail.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] team: fix promisc/allmulti leak in team_port_add error path
Date: Wed, 21 Oct 2026 23:31:34 +0000	[thread overview]
Message-ID: <179262549484.3135.4170374888758470741@kernel.org> (raw)
In-Reply-To: <20261019083122.1841-1-lirongqing@baidu.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The patch has the wrong Fixes: tag.

--

team: fix promisc/allmulti leak in team_port_add error path

This commit undoes the port's promiscuity and allmulti increments on the
err_set_dev_type path of team_port_add() in drivers/net/team/team_core.c.
Before this change, that path left both increments in place when
team_dev_type_check_change() failed.

> Fixes: 43c2adb9df7d ("team: set slave to promisc if team is already in promisc mode")

[Severity: Medium]
Is this the right commit for the Fixes: tag?

Before commit 0ae9cfc454ea ("team: Move team device type change at the
end of team_port_add"), team_port_add() called
team_dev_type_check_change() near the top of the function. That was
before the port was allocated or promisc/allmulti was raised, and a
failure there just did a plain return err. So in trees from 43c2adb9df7d
up to 0ae9cfc454ea, no increment exists yet when the type check fails.

Commit 0ae9cfc454ea moved the call below the promisc/allmulti block and
added the err_set_dev_type label. That label falls straight through to
the other labels:

    err = team_dev_type_check_change(dev, port_dev);
    if (err)
        goto err_set_dev_type;
    ...
err_set_dev_type:
err_set_slave_allmulti:
err_set_slave_promisc:
    __team_option_inst_del_port(team, port);

This sentence in the commit message is therefore only true from
0ae9cfc454ea onward:

> team_port_add() increments the port's promiscuity and allmulti
> counts before calling team_dev_type_check_change().

Trees that have 43c2adb9df7d but not 0ae9cfc454ea have no
err_set_dev_type label, so a stable backport based on the current tag
would not apply there.

Should the tag be the following instead?

Fixes: 0ae9cfc454ea ("team: Move team device type change at the end of team_port_add")

The code change itself looks correct. It matches the cleanup in
team_port_del().

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261019083122.1841-1-lirongqing%40baidu.com

      parent reply	other threads:[~2026-10-21 23:31 UTC|newest]

Thread overview: 5+ 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
2026-10-21 23:31 ` netdev-bot+sashiko [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=179262549484.3135.4170374888758470741@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.