Article View: linux.kernel.netdev
Article #6352[BUG] net: bridge: failed attach leaks slave promiscuity
From: Cheng Yongkang
Date: Thu, 22 Oct 2026 09:14
Date: Thu, 22 Oct 2026 09:14
42 lines
12334 bytes
12334 bytes
Hi all, br_add_if() can acquire a promiscuity reference for the new slave before a later error sends it to the err6 unwind. nbp_vlan_init() allocation failure is one reachable point. The successful prefix does: list_add_rcu(&p->list, &br->port_list) nbp_update_port_count() br_manage_promisc() br_port_set_promisc() dev_set_promiscuity(dev, +1) The err6 path then removes the port from port_list before the remaining nbp_update_port_count() call, so the removal path cannot see or clear the port's promiscuous state. The later dev_set_allmulti(dev, -1) balances only the separate allmulti reference. Observed on Linux v7.3, commit 08ab31164c55f20c7a2653de3186ae333470e2c1. Failslab forced an allocation failure in the first nbp_vlan_init() allocation. The failed attach returned an error and left no master, but the slave's IFLA_PROMISCUITY grew 0 -> 1 -> 2 -> 3 across repeated failures. A later successful attach/detach moved the counter 3 -> 4 -> 3. Another successful cycle returned to 3, proving the first attach/detach pair was balanced and could not remove the references leaked by failed attaches. The error path must explicitly release the promiscuous reference before unlinking the port, or reorder teardown so the normal promiscuous update still includes the failing port. The PoC, fault-injection runner, and complete program/serial logs are available on request. This was found with a multi-agent workflow; the state leak was reproduced under KASAN+UBSAN (no crash is expected). Thanks, Cheng Yongkang
Technical Details
Message-ID:
<20261022091445.3650534-1-teel4res@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350456-linux-kernel-netdev=dewy.ruShow 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-350456-linux-kernel-netdev=dewy.ru
From: teel4res@gmail.com (Cheng Yongkang)
Newsgroups: linux.kernel.netdev
Subject: [BUG] net: bridge: failed attach leaks slave promiscuity
Date: Thu, 22 Oct 2026 02:14:45 -0700
Organization: Usenet Network
Message-ID: <20261022091445.3650534-1-teel4res@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="173199"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:sYXV3ZQnXGniwkqR9YvKVAO7wgk= sha256:0u+mj43beP8q3EuCSe6tSmF4zwhYmsvwwTu1DoYnpzw=
sha1:1xGRV5ot7RlTszRWcKFzcjtqWM4= sha256:gG1/S3jd1te84yWqNo+SDgBRdH4VyNdIOI8cr042tAY=
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 E7FEA1111FE; Thu, 22 Oct 2026 12:21:48 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
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 x1OOTkiZmISP;
Thu, 22 Oct 2026 12:21:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-350456-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 3EB671111B6; Thu, 22 Oct 2026 12:21:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id B48AA2F3F8; Thu, 22 Oct 2026 09:15:00 +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=1792660494;
b=FHMRQuRYQxhAo6mg8BzTXdsLedUmnOmeIn/1N8VPLT6a+gDFmYRFfp7HWjoBYWnSO5sP
iS5rXlT1t/Gj6FLboWPAUAnR6rw38fo4mRdM5Nxowlq73TXqteDNZM/GnP4mXOHim/Z2M
1tUSn3u6wcqsJj9H5qgsRJXLj9ikYPDUZRMl7hD6+Fyx4VWta5nNHAGS4edBeb52gblHB
QREQ35YczSFQ1GqZPEKDm/kuI/tUMxlRGtj1FxKdMRDBqq7X558rM8osOyOqW1DmQT0sV
is/2KUbjiT3LpPZTZR0aMjINMhwrnzwnzjuEY4z8PHCOgMd4V2ij4MGf3b5fNCrx4hQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792660494;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-Id:
X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Transfer-Encoding;
bh=fUpHgJn4/5UVMTDClUybGN+1JsPzSxgZqen/j5U67+4=;
b=xoM/MtE7laEN0TOUx9DHl5aMCXoTSc7PeP8MYyEXwKCuMLFytdnaBlclyhcpP9PYe6Ch
j0ULOqALMTPhAbDBhqbVkvm+FPSpF9xFauMWegzfDJ3lKKen5xeDtCc1lBETvqUtbf11S
V6gSwn9S9HRD72VXsaaskZbYi3UZWVVNiR7PrCMFycy9hjn/H2xv/0JKXsidjSE4GYeyZ
EYqyMtJHCW/Jd4UJqK6H+xwJQOqmS/0jSFTXgcNWJHoluZUiuHOpjw7Y/R2/aMr6OYM39
zxBlkD+ZCRFPD9yS/bUoSxXD2G5KizlAb8CBekgMkIk1cioPkhKwTdYeU2ThqSC/11w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=OPLZIOW9;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 88507606A321;
Thu, 22 Oct 2026 09:14:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=OPLZIOW9
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.173
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792660493;
b=YaAkE6w6wdHdUVfoDwgbvYcO9/Y0xHz2ajlJokqt+zdEkMXx171O+NCVUGot0jClM5j1
GgIGpTATbpm4HU2xWgUeCY8sHwTsUr+Mw40AlvnjjW20qBsJDmAmZe8E2XYDvMGJ81ySz
nHHMeFYQlGqToq8CdV8xIwxvHz5bQojzsxs/udj5/KSzhEwGfBoz7vbUkXpoPa/bYWs5S
ZwTGgE/Lb1AElPOsljiWPUUBF9vWxcxP8htEBB2+MEgHCf2cawrWRHaMDdqCAgr4PdIdu
EZI+teDmEKhkNvpRB19q+tBZTw6GKjM51KkNmFIgBgiNDihtnmuq+3Y+6pejvswIDiQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792660493;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-Id:X-Mailer:MIME-Version:Content-Type:
Content-Transfer-Encoding;
bh=fUpHgJn4/5UVMTDClUybGN+1JsPzSxgZqen/j5U67+4=;
b=0dhMvy3vHL4w1Fw6LfoBB8iGVu3f87qB4jduETnAKS+qZgvWhMLm4NAPEiqWH4/JwI5W
6iypw94efopBYW2S7ILmYG4YlDimGURNlSIn95vPJMvNgjwU0Yfm9K++ECYt6JGUetm9Z
MvmjeffphZT6UTmEgooO/cgYKWDR719674zbWiNj0H3ShTSavUzw5cugA7NowO7Kf56JL
w+qlhAK9MwMcZyDwr4LdePU8RdJKrMYC0qZsYS17K/tyajzWdnGMfoNEERCGRt+PssosX
johwC7RSo79kuJwLD9ZjJYFi9lXbp5f7Rj/lJjPBAPJb3DnsZuo7QjFn/plig1mAJDA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=OPLZIOW9;
arc=none smtp.remote-ip=74.125.82.173
X-Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F81D606A327
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 09:14:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5F81D606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-36661f953e4so2991745eec.1
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 02:14:53 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792660492; x=1793265292; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:mime-version:message-id:date
:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=fUpHgJn4/5UVMTDClUybGN+1JsPzSxgZqen/j5U67+4=;
b=OPLZIOW9Y86Du66N6PpGEv2rrXIzo7DC/u9Rtm6Goq4g8e31ID2NCNFY9uCn8zHX5J
Q3K5fWA5s0/tnaqEN3SpmOPRI6/JUnFxozHd9kPO+KkFLynHq0zP1eQLl4DJPMzNVvGI
Mlx9R3Q6rQaW3ImGGmJ9TpMeeHMQMsKk73KGnldSxUjjlSp33RHeCqLJsAgzqOBchuTH
8wO1IKtg55FCfnS4Em09lrDnlxtmQjG25v6RQ8z1EtCIAEowcyPQXycahSZW4h0O+Bv2
17+tSg8bwfG+Arr+nGReidwwtIJwrsqMN8qXnKZxzXgdOLsVzsPunysI/Tr0mTYbHSmK
AbPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792660492; x=1793265292;
h=content-transfer-encoding:content-type:mime-version:message-id:date
:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=fUpHgJn4/5UVMTDClUybGN+1JsPzSxg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wMmJQHBhrvgDXWUe6OoSFAX/wz0IyugyP4MrpfjHAO72
H9wEXYsDVt4PSOeo3Z7m375PTN9ER7plHmTQeqvvmj7L5rqHfnM7dfYnpNwIjIeP0qCFvAvi1ZQ
loD3ICl1nmE0V0RXN1Y=
X-Received: by 2002:a05:7022:1608:b0:166:37d2:3b72 with SMTP id a92af1059eb24-190a6add68bmr5187470c88.27.1792660492388;
Thu, 22 Oct 2026 02:14:52 -0700 (PDT)
X-Received: from youngkk-vm.localdomain (67.216.200.102.16clouds.com. [67.216.200.102])
by smtp.gmail.com with ESMTPSA id a92af1059eb24-1903c71421asm13121003c88.16.2026.10.22.02.14.48
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 22 Oct 2026 02:14:51 -0700 (PDT)
X-Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
bridge@lists.linux.dev,
netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.34.1
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