๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6234

Re: [PATCH] team: fix promisc/allmulti leak in team_port_add error path

#6234
From: netdev-bot+sashiko
Date: Wed, 21 Oct 2026 23:31
67 lines
10221 bytes
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
Technical Details
Message-ID: <179262549484.3135.4170374888758470741@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350307-linux-kernel-netdev=dewy.ru
References: <20261019083122.1841-1-lirongqing@baidu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350307-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] team: fix promisc/allmulti leak in team_port_add error path
Date: Wed, 21 Oct 2026 23:31:34 +0000
Organization: Usenet Network
Message-ID: <179262549484.3135.4170374888758470741@kernel.org>
References: <20261019083122.1841-1-lirongqing@baidu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="86946"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:OVEtocailV9vDxVtic5xh1dobAY= sha256:SODbs4U1URiRvpggqoQk4iy8N5N0PeRyzB8v3/rhPRc=
	sha1:4lMGX2rr5zc7XWUiJatNprbM7HY= sha256:p8dEbIqwCxUPy7ugOxiOnTw7FX6itCiALc/kdwFEg0E=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 830DD111157; Thu, 22 Oct 2026 02:32:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id rs-66ku5pUWP;
	Thu, 22 Oct 2026 02:32:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350307-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id B2D8411112F; Thu, 22 Oct 2026 02:31:59 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 5810C36F17; Wed, 21 Oct 2026 23:31:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792625502;
	b=Gk1Ro8Ej+pIfUnmA0LVRGbUqq7g3mVIRITrdTfIl3XcbPKfgJB5HR6We8zzmfuUEQjMM
	 weHIPBhECAozKSi4gpQgKkb7Q+UnMiGKutVhx+I11ZI/sgRAvc1emrZ2Hut6I7owX2LSU
	 3m46eZmEMrf2n6CmhbA9r0WVxN8yDOtH4J0nCOptQ4N3Zb9gd9ynIkAIhqxPQsmVegv7A
	 41+8706sQGYx9YIlEnBRk91iW7FEEI2/i6RLH7VCN/JIowh0nEL3r+Tq2yUhOVwTtiKlU
	 o54sQb24BABBDw/VilBe5dC5YTdp17UXOfqRhShecRMOHEcAwhdQOzwNLqXyE4hU3tA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792625502;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=gubuEfC9JrzapkKE3aUtTaIp1VZ+4CaTKPQp6ZYOx5c=;
	b=Ta595Jz7cfkU5DPDrW6IZFpStLktEfdHjFAhIvnqJUrUT49EGLVyhCEZhz/514TPmMtL
	 apjcSVmGk0y4XexfTMDuo0H2YjgZ3CtUNEqm6moLoYW1UaHrwpnQqkzi0G17XOw1YXrGN
	 vypgVaT1hdXPbIzZ0t9QkTNJvHbTX6kkT/RXTZt5XGe6Erx1p/iVj3vLUbvIdWHv+HwRH
	 UyW4iGe8ZinwBs6qrmW1TcMYgODkueXQlz35IfMwyMSy4xRJ8RlK7zh7RoZaCTo/ajg7k
	 1UHG9tJ5VRgGDcZeB/CpA20epvOFiHwEzgRIzYPEDCLMXSNLFUjzLvIZwpR9kGuq45g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=o3b1VjgQ;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FA6B606A322;
	Wed, 21 Oct 2026 23:31:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=o3b1VjgQ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792625496;
	b=wZ23fOPx16tXmpzy4ZfTskEGGk+1WQVSo/FZl7xt16HzhiQhWH9q/AYC4xTbe2VIfFjY
	 nAzdsYK/TIRdEW6M9v/Sju7ROqELbDA42Dmh501BKiboFKWFA7fYb5pQpNcyqrKSNvrUi
	 2lvrGjfS48CF1GC5RJZH839ufKdAtUXogfh3h6FlC6EZEwQFIVgQ8NBDhrc+7dusvXMe5
	 lsnxsmQGOiAUKL0Zw4WLMKxhw1p2hhPkmKPZXA1lnIivLdeCcTX7I8kYZVOTue0/Fa8XT
	 BKyQy10xNVWF7eS6DGsYbGRzsjU7DfvBoMDnODb/V/31tOs28oAr08YIOuFPAmDJQVg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792625496;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=gubuEfC9JrzapkKE3aUtTaIp1VZ+4CaTKPQp6ZYOx5c=;
	b=IMfRffNKEH3uJISPEQiSd/HLG/NmpcOsnPc3tUDnVR2vJSaZnnDOBphpzTccSVZL7I3e
	 XNhCsZjvtQvEBZhRgCX+/I+WzuCz3u7F+wboDyQEbi5268kegFbaggEeqYsAIv4I4rbSy
	 zpOVwY4F8Jilbe96SzIVFSHc+gnUmlmBMpkDqux50YGkg92Mh3IA+adYz+rf+86ONRi2c
	 LGpN96goh6J8l0luH0MTCVPCA2a/xIij6I6lfK49Q+iyQgZH/PM2EJ9IKAaWwdrmZPzIT
	 5UWVhrA1JMowfalNRTshIHQx8EFEviD4ZGg6WLHvP6VmSPpPl9k8iGtZTurBPOTMC/g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=o3b1VjgQ;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C98A606A319;
	Wed, 21 Oct 2026 23:31:35 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C5301F000C1;
	Wed, 21 Oct 2026 23:31:35 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792625495;
	bh=gubuEfC9JrzapkKE3aUtTaIp1VZ+4CaTKPQp6ZYOx5c=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=o3b1VjgQL/Jp7P7fyxjOMoMPX2DJQVIZKZ1Qm7b+Gbyz0gDgkTKaBq9L4OcffYGug
	 T6D/tBPIZRQLga1skI8SGMEsrsmn5rwFjGw33sEQCaV9FrIRW54QhKN13vQvCx2u8C
	 tI1Ne9KaOSwFtTprgHCB8Vw+DbHFZf/jfaencH4xgWf8u3Rh8bpQ8NPoZxwFyKExWr
	 y2la8+py1f17DcRerJjSCKH1TYKglUb9Hek0SoQaSOVAhcQ+Tx+Sm4OVrMAHOu6/Sp
	 34SLMSwACixU9xqkUevWlcsQrefQ97al474xC9oAubE1tHYO5a6SOuyaU6wwfsX+aj
	 LJyHn2l97hvJg==
X-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
X-In-Reply-To: <20261019083122.1841-1-lirongqing@baidu.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list