Netdev List
 help / color / mirror / Atom feed
* [PATCH] team: fix promisc/allmulti leak in team_port_add error path
@ 2026-10-19  8:31 lirongqing
  2026-10-19  8:38 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: lirongqing @ 2026-10-19  8:31 UTC (permalink / raw)
  To: Jiri Pirko, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Hangbin Liu, netdev, linux-kernel
  Cc: Li RongQing

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:
 err_set_slave_promisc:
 	__team_option_inst_del_port(team, port);
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] team: fix promisc/allmulti leak in team_port_add error path
  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
  0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-10-19  8:38 UTC (permalink / raw)
  To: lirongqing
  Cc: Jiri Pirko, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Hangbin Liu, netdev, linux-kernel

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by code inspection). If it was triggered please include
   the symptoms, like the stack trace or error messages.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-19  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox