CVE-2025-40297: net: bridge: fix use-after-free due to MST port state bypass

Published Dec 8, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

net: bridge: fix use-after-free due to MST port state bypass

syzbot reported[1] a use-after-free when deleting an expired fdb. It is due to a race condition between learning still happening and a port being deleted, after all its fdbs have been flushed. The port's state has been toggled to disabled so no learning should happen at that time, but if we have MST enabled, it will bypass the port's state, that together with VLAN filtering disabled can lead to fdb learning at a time when it shouldn't happen while the port is being deleted. VLAN filtering must be disabled because we flush the port VLANs when it's being deleted which will stop learning. This fix adds a check for the port's vlan group which is initialized to NULL when the port is getting deleted, that avoids the port state bypass. When MST is enabled there would be a minimal new overhead in the fast-path because the port's vlan group pointer is cache-hot.

[1] https://syzkaller.appspot.com/bug?extid=dd280197f0f7ab3917be

Affected Software

3 affected componentsFixes available
linux_kernel
Microsoft azl3 kernel 6.6.112.1-2
Microsoft azl3 kernel 6.6.112.1-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Disable VLAN filtering (net/bridge VLAN filtering must be disabled) to prevent fdb learning during port deletion.

    Linux kernel net: bridge VLAN filtering = disabled
  2. Compensating control

    Enable MST (MST enabled bypasses the port's state) so that the bridge port's vlan group pointer bypass can avoid the use-after-free during port deletion/race with learning.

Event History

Dec 8, 2025
CVE Published
via MITRE·12:46 AM
Data Sourced
via MITRE·12:46 AM
DescriptionSeverity
Data Sourced
via NVD·01:16 AM
DescriptionSeverity
Dec 9, 2025
Data Sourced
via Microsoft·01:03 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·01:03 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2025-40297?

CVE-2025-40297 has a medium severity rating due to the potential for a use-after-free vulnerability that can lead to system instability.

2

How do I fix CVE-2025-40297?

To fix CVE-2025-40297, update your Linux kernel to the patched version that addresses the use-after-free issue.

3

What systems are affected by CVE-2025-40297?

CVE-2025-40297 affects versions of the Linux kernel that utilize the bridge networking feature.

4

What type of vulnerability is CVE-2025-40297?

CVE-2025-40297 is classified as a use-after-free vulnerability in the Linux kernel.

5

What causes CVE-2025-40297?

CVE-2025-40297 is caused by a race condition that occurs when a port is deleted while learning still happens.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203