CVE-2026-143270: net: bridge: disable MRP ports before the FDB flush in del_nbp()
In the Linux kernel, the following vulnerability has been resolved:
net: bridge: disable MRP ports before the FDB flush in delnbp()
delnbp() flushes the port's FDB entries before it unregisters the RX handler. For a normal port, brstpdisableport() moves the port to BRSTATEDISABLED before this cleanup.
That does not hold for an MRP ring port. brsetstate() ignores state changes while BRMRPAWAREBIT is set, so brstpdisableport() leaves the port state alone. brmrpportdel() then restores forwarding when the bridge is up before clearing the bit. A frame received between brfdbcleanupbydst() and netdevrxhandlerunregister() can therefore create a new FDB entry referencing the dying port. Nothing removes that entry before destroynbprcu() frees the port, so a later frame to the learned MAC can be forwarded through the freed port.
Remove the MRP and CFM instances before disabling the port, so that brstpdisableport() actually transitions it to BRSTATEDISABLED. With CONFIGBRIDGEVLANFILTERING=y, synchronizenet() in nbpvlangroupunpublish() also drains receive paths that could still learn with the old state before the final FDB cleanup.
Found through an LLM-assisted source code analysis workflow and reproduced on net with KASAN and CONFIGBRIDGEVLANFILTERING=y in QEMU. A diagnostic switchdev module accepts MRP objects and delays the NETDEVCHANGEUPPER callback for 1.5 s, holding delnbp() after the FDB cleanup and before RX handler removal. The reproducer floods the MRP port with rotating source MACs, waits for the port's RCU callback through the module's rcubarrier(), then sends frames to those MACs from another port. The unpatched kernel reports:
BUG: KASAN: slab-use-after-free in brforward+0xb1/0x820 Call Trace: <IRQ> brforward+0xb1/0x820 brhandleframefinish+0x148b/0x1e50 brhandleframe+0x90a/0x15c0
With this patch, three runs of six cycles each reach the delay without a KASAN report.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Remove the MRP and CFM instances before disabling the port.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux bridge subsystem with Media Redundancy Protocol (MRP) ring ports are exposed during removal of an affected bridge port. The vulnerable path depends on MRP-specific port state handling; normal bridge ports are disabled before their forwarding database entries are flushed.
What condition is required to trigger the use-after-free?
A frame must be received in the interval after FDB entries for a departing MRP port are cleaned up but before its receive handler is unregistered. That frame can create a new FDB entry pointing to the port, which may later be freed and still used for forwarding.
What is the practical mitigation if an update cannot be applied immediately?
Avoid removing MRP ring ports while the bridge is receiving traffic. The issue is tied to the teardown race for MRP-aware bridge ports.
Does VLAN filtering affect the issue?
The fix includes additional receive-path synchronization when bridge VLAN filtering is enabled. This ensures receive paths cannot learn FDB entries using the old port state before the final FDB cleanup.