CVE-2025-40297
JSON

7.8high

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

Severity
7.8high CVSS:3.1 by Linux
Exploit likelihood
0.17% (higher than 6% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

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

Product or packageVersionsReported by
Linux Linuxfrom ec7328b59176227216c461601c6bd0e922232a9b before e19085b2a86addccff33ab8536fc67ebd9d52198, from ec7328b59176227216c461601c6bd0e922232a9b before 3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8, from ec7328b59176227216c461601c6bd0e922232a9b before bf3843183bc3158e5821b46f330c438ae9bd6ddb, from ec7328b59176227216c461601c6bd0e922232a9b before 991fbe1680cd41a5f97c92cd3a3496315df36e4b, from ec7328b59176227216c461601c6bd0e922232a9b before 8dca36978aa80bab9d4da130c211db75c9e00048, 5.18
Not affected: before 5.18, from 6.1.159 up to 6.1.*, from 6.6.117 up to 6.6.*, from 6.12.58 up to 6.12.*, from 6.17.8 up to 6.17.*, from 6.18 up to *
CVE List

Classification

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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

NVD (es)

En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: net: bridge: corrección de uso después de liberación debido a un bypass del estado del puerto MST syzbot informó[1] un uso después de liberación al eliminar un fdb caducado. Se debe a una condición de carrera entre el aprendizaje que aún ocurre y la eliminación de un puerto, después de que todos sus fdbs hayan sido vaciados. El estado del puerto ha sido cambiado a deshabilitado por lo que no debería ocurrir aprendizaje en ese momento, pero si tenemos MST habilitado, omitirá el estado del puerto, lo que, junto con el filtrado de VLAN deshabilitado, puede llevar al aprendizaje de fdb en un momento en que no debería ocurrir mientras el puerto está siendo eliminado. El filtrado de VLAN debe estar deshabilitado porque vaciamos las VLAN del puerto cuando está siendo eliminado, lo que detendrá el aprendizaje. Esta corrección añade una verificación para el grupo de vlan del puerto que se inicializa a NULL cuando el puerto está siendo eliminado, lo que evita el bypass del estado del puerto. Cuando MST está habilitado, habría una sobrecarga nueva mínima en la ruta rápida porque el puntero del grupo de vlan del puerto está en caché caliente. [1] https://syzkaller.appspot.com/bug?extid=dd280197f0f7ab3917be

References

Sources

SourceRecordLicence
CVE ListCVE-2025-40297 changed 2026-10-15CVE Terms of Use
NVDCVE-2025-40297 changed 2026-10-15Public domain