Article View: linux.kernel.netdev
Article #6343[BUG] net: bridge: late FDB learning can outlive an MRP port
From: Cheng Yongkang
Date: Thu, 22 Oct 2026 09:04
Date: Thu, 22 Oct 2026 09:04
59 lines
12840 bytes
12840 bytes
Hi all,
An MRP-aware bridge port can remain in BR_STATE_FORWARDING during
del_nbp(). The terminal br_fdb_delete_by_port() runs before
netdev_rx_handler_unregister(), so a frame received in that window can
learn a new FDB entry whose dst is the port being deleted. No second
FDB sweep follows. The port is then RCU-freed, leaving the FDB entry
with a stale net_bridge_port pointer.
Observed on Linux v7.3, commit
08ab31164c55f20c7a2653de3186ae333470e2c1, with KASAN+UBSAN:
BUG: KASAN: slab-use-after-free in br_forward+0x55/0x3c0
Read of size 8
br_forward
br_handle_frame_finish
br_handle_frame
Allocated by:
new_nbp
br_add_if
Freed by:
kfree
kobject_put
rcu_core
The failing sequence is:
br_stp_disable_port() leaves the MRP-aware port forwarding
br_mrp_del_impl() restores BR_STATE_FORWARDING
br_fdb_delete_by_port()
... late ingress frame learns fdb->dst == p ...
netdev_rx_handler_unregister()
call_rcu(&p->rcu, destroy_nbp_rcu)
later frame -> br_forward(stale dst)
This reproduced in three independent VM boots. The target bridge code
was unchanged. Because the test VM has no driver that accepts
SWITCHDEV_OBJ_ID_MRP, a small diagnostic switchdev endpoint claimed the
MRP object and widened the already-existing post-FDB-flush/pre-unregister
window. It did not replace bridge logic, modify FDB entries, or alter
net_bridge_port lifetime.
The deletion path should stop new RX processing before the final FDB
sweep, or drain the deferred/FDB state after the RX handler is
unregistered and before queueing the port for RCU free.
I found no matching upstream fix. Candidate BR-007, BR-040 and BR-058
are consequences of this same root cause. BR-040 gives the forwarding
window; BR-058 independently describes the stale-FDB lifetime.
The reproducer, module source, and complete serial logs are available
on request.
This was found with AI-assisted source analysis and fuzzing; the kernel
behavior above was reproduced under KASAN.
Thanks,
Cheng Yongkang
Technical Details
Message-ID:
<20261022090431.3641707-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-350444-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-350444-linux-kernel-netdev=dewy.ru
From: teel4res@gmail.com (Cheng Yongkang)
Newsgroups: linux.kernel.netdev
Subject: [BUG] net: bridge: late FDB learning can outlive an MRP port
Date: Thu, 22 Oct 2026 02:04:31 -0700
Organization: Usenet Network
Message-ID: <20261022090431.3641707-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="171126"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:tqzyFAod85KKWWn0FkSqUHR0AsE= sha256:39ZGCd+yvQdDka+BPeBCHC7nR/Af6uZ/fTm0gF54jUE=
sha1:BgY87/QAWmO3DbrsYwLqI2EDMv4= sha256:BHBwfUECuwzIq/o58uX3dAjF8n1tiMFeQck9q6lIDtM=
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 13C471111E3; Thu, 22 Oct 2026 12:10:50 +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 kQFXuw9ypGX3;
Thu, 22 Oct 2026 12:10:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350444-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id D296A1111F0; Thu, 22 Oct 2026 12:10:33 +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 8E52C30C06; Thu, 22 Oct 2026 09:04:54 +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=1792659891;
b=gWgPFWBl20/08Kk7cxRCVzInQ/NvzYGM6fqKxP8N8E+SiHUBQ9cbzZMihOZ4ctQ8NZjE
axUll0CSm2WdxBlKQ+5npqCCxVYklCesBNjgIR1o5Ig0Zao+N80uUG/LouUn2fruuU0eV
vyq4yEvPRlYis5RwW7LHaLX/sRLxyBDHM0VrRuL7PiFFkKVZOZgYVX+uyCxI2QX28kVzL
Z/ZDJBSPiCz4Q1l5WYcrcR62AiRC1b7ep4tBzIidarmfAjbWCQeyTxK+0S+pfl9pokAP8
buNEWh+Bq5Phjxxav06W0HNv5YnRkgF2QyBo52dPLb98ygMjsk02cYXWjyMS2DHazww==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792659891;
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=ppDEP6lrPx9xfq6MNzv2Y3tsqjuRimolFRwRFB5o2fM=;
b=Ud23fYo9GCIy2+kPn5yORoERzHdA/TjvjwA7fFP323r21DiNj9ytNaCQCUomxSeArpzW
2DhUv0MZiqXCJw0Jrq3N8sw8pQZZk1lgYM4MBosb9lEF0LAx2Qg8UeABDJS0QN6s0Ek1P
5/Kp6LtTUpSoCz1Qzz4W90ztckZ9KkiuE9WxIoO1Dz7XMLqpPlwgo/f8wU3VAoAYHJVyL
D+bbzYEOzUJ/oK0oHqS18gCO0wXs2wBwgPGZ0PkRcDSVcnNBiyxd8Ll1fkLg7ovVGX919
aLdjC5CBsxEVDEgrhp63xvOfimJRX7TGEZyo2eiiGctO+QR+0TYHSqnrWMTYoJ/XmlQ==
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=IJoTo9rd;
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 DB9C9606A331;
Thu, 22 Oct 2026 09:04:51 +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=IJoTo9rd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792659881;
b=3JOyO+gxcNtbxU8ws2EcPy3U2u9jTf5d3vIBvcinl74xxOx5UYrzZqS4bknomfrMPxcD
EejrptI/Vrkl5xtLGF30zrlL/GPYEbXyMJweIVc5NBgMv6gcioObsG5o9DRouhPSbg4gf
o1uELajutUZov4JHqQ+Hj19penV9RvvRVBXavo/Au1kN811UcJD/MOI/dx2FkXxX9jx7S
EuIVDO65ORThU1tysVnpSuFa98FfkIjS1qBIWf0QEhmD5O4iV1xWADd5ptm50QcRehbjv
cWzeRjfOsryQgCrTiNFvZ98vyUbTiM3N4Z2ogkB+VIE3gZ+jUr5braXEZlmkHrRkHrA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792659881;
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=ppDEP6lrPx9xfq6MNzv2Y3tsqjuRimolFRwRFB5o2fM=;
b=X673+NhZwNWW4C6BwWn56MQ8LD9iAQgalAmPzA2f4Ejr96TbnkFxW0i7W4YoCuM5tOtR
ZIPk+DNnIWHck/JVe32A4TkjqfcMpJlW21jvCgs+riYYiYlkqzwGruqH2JOS85FmOCwZy
HZFStZivp5Fq4ZGWrZ8nZs7GouxW1V98WXmYs57CJ06nkIdgJqZARiPpy1HTZtSe8KGBk
lresB0TLoI6qwBf4YHfbQ6V8k/oVkTIqYCU4HBKX01bNdhzoCgAK/GJVp+sKBCZE/56hC
dhpQ91lLwIaEcuAN33elYTO4uVLhZrJ2kZQiprolhAD/MNOM3JVwBIZxeZ697W7F1zw==
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=IJoTo9rd;
arc=none smtp.remote-ip=74.125.82.179
X-Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179])
(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 A6D7D606A31D
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 09:04:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A6D7D606A31D
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-f179.google.com with SMTP id 5a478bee46e88-35b2c599f43so3630105eec.0
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 02:04:40 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792659880; x=1793264680; 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=ppDEP6lrPx9xfq6MNzv2Y3tsqjuRimolFRwRFB5o2fM=;
b=IJoTo9rdAbqSFGz7b2xuHJqrpSv6xT2Ady6/lLee/5qVeEyyXOkCyV96qbzMgPwj0W
+0J9MGjZ7iIBfUYZ94hoNQZO9XRc670630CqdJhhkIpjjgyZIG9CRcDZLPNP/pr9XsCT
rJ4kypdqrTipRYZvi7doTrwORMDoo0TUDRZCWSxIbsBPVHdhiatbzRJFOsb0c6wLubon
pvxIto8AG+NOBe+7yW1Bw98BFOpQymH2v6fNfb2EZxVPlfrguSsGPLZhaqDY8pG7Fd8j
UdjuzfoDmh3M5C4b12KYgA6HAnQowB0LvOvKJ9PlowEfkrt2Dl8Ip3AuvrrH5C88yUyB
yzew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792659880; x=1793264680;
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=ppDEP6lrPx9xfq6MNzv2Y3tsqjuRimolFRwRFB5o2fM=;
b=ewRM8PeceW2JZ5TcdbxmvPW9CBWwOu9fCrVdPCAw1ORe+yXzdqA39USJh5tylB6unC
UzSB4mRNGR98IloEsj5F5UNS/iS9hP0sCKYtxsJpF4DF1mvvitq7VYSwL4hI4zjAn1TF
Ubo8WDhPL2tZ9ehp5+vN8JKZV6hYuzm3KdAQ618SL2rrWmj52pL9ELZnumKxBupUhT/3
6EH23ZXaPYW3KOf36O7eYT3mD6Df+eMEBU6sGyuU91noKBCm/LioLltz9Q7UyJt6LFtx
guHXA9uRtzdoS55DjXQRWosOS08teDp3pPk6CFRh71/8xzHGCnn2qYCH8y6vopApip5q
6qvA==
X-Forwarded-Encrypted: i=1; AKwUvBzwkBHwdEOgqBTKO/4GbSUx3ZYrPdqymdtdlamP30vCkIUTQBQ/VPoAgPJq1O9Hm3fSRGhoNvY=@vger.kernel.org
X-Gm-Message-State: AFq9FYJ8jCA8M2WiVtpnDKK7xUn7EwkhSw3DxeF4lwvcwuK6wZymZypl
LYiXRUEnosBv0kn4gte0c8U+tURCsZ7VOTkv07QMUqrOItAPbCLJN5LN
X-Gm-Gg: AYBFou1MVKephbFcPmjSIpncl9sbHnxB867SZW/uIOAcez0rexHcs0lEOYmKAuZFHz6
QX8ch8ApVq+ruX7SuPHyalRoth6KCx47C/k6GYscjR71gYI1hWX/hqWz0GT4FWxZqk2R4PlCNI/
jZ3Ud9sblhPeNiDWGlrMflKFnw/qReJ9O8k+PsVkTiEUjo3mtVj3iIBG+bL4wDVLmc+/UOVNhgO
j93uOPDzuFdYg0+8kmp3+66ScFdDUsQbWzRO9LxzpjgDlpK1nwtGHK8/BV6Kcp9f35tvEnwGNvw
f/8q5IyslUBRHFWw4lVblbami86KrxPNIdbvP6lkqKZJGx2JPO2Sssyx4W9R1VbaKYyvCdwwk+s
HgR3YjeY/2xILuY5FdPdvjNoW9wGeMNkuD65jg6txMy/4vw5yMwGb5GQXZaAqyuTql8LesA21jg
qPLZdA6fuNjQd76bA3oQsBk3p68fSqpu1llNTpFaql3JGXl+eR48Xwh4rj0VnwYhiBM6VeFYJoZ
cjmhUMbpMAPfnmxMZJlN+ZFBBaBYh/5f3LnJNCoFY+vA7dCBQe9b4f8yAMVAu7l178f1yVOm1F/
JA7fJyN30tPg2lagF6A=
X-Received: by 2002:a05:693c:620c:b0:356:b370:a0ee with SMTP id 5a478bee46e88-3674e15fa01mr7570801eec.20.1792659879720;
Thu, 22 Oct 2026 02:04:39 -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 5a478bee46e88-367411b4145sm16789928eec.15.2026.10.22.02.04.36
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 22 Oct 2026 02:04:39 -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