{"id":"CVE-2025-40297","aliases":["CVE-2025-40297"],"related":[],"kind":"vulnerability","state":"published","title":"net: bridge: fix use-after-free due to MST port state bypass","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: bridge: fix use-after-free due to MST port state bypass\n\nsyzbot reported[1] a use-after-free when deleting an expired fdb. It is\ndue to a race condition between learning still happening and a port being\ndeleted, after all its fdbs have been flushed. The port's state has been\ntoggled to disabled so no learning should happen at that time, but if we\nhave MST enabled, it will bypass the port's state, that together with VLAN\nfiltering disabled can lead to fdb learning at a time when it shouldn't\nhappen while the port is being deleted. VLAN filtering must be disabled\nbecause we flush the port VLANs when it's being deleted which will stop\nlearning. This fix adds a check for the port's vlan group which is\ninitialized to NULL when the port is getting deleted, that avoids the port\nstate bypass. When MST is enabled there would be a minimal new overhead\nin the fast-path because the port's vlan group pointer is cache-hot.\n\n[1] https://syzkaller.appspot.com/bug?extid=dd280197f0f7ab3917be","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: bridge: fix use-after-free due to MST port state bypass\n\nsyzbot reported[1] a use-after-free when deleting an expired fdb. It is\ndue to a race condition between learning still happening and a port being\ndeleted, after all its fdbs have been flushed. The port's state has been\ntoggled to disabled so no learning should happen at that time, but if we\nhave MST enabled, it will bypass the port's state, that together with VLAN\nfiltering disabled can lead to fdb learning at a time when it shouldn't\nhappen while the port is being deleted. VLAN filtering must be disabled\nbecause we flush the port VLANs when it's being deleted which will stop\nlearning. This fix adds a check for the port's vlan group which is\ninitialized to NULL when the port is getting deleted, that avoids the port\nstate bypass. When MST is enabled there would be a minimal new overhead\nin the fast-path because the port's vlan group pointer is cache-hot.\n\n[1] https://syzkaller.appspot.com/bug?extid=dd280197f0f7ab3917be","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nnet: bridge: corrección de uso después de liberación debido a un bypass del estado del puerto MST\n\nsyzbot 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.\n\n[1] https://syzkaller.appspot.com/bug?extid=dd280197f0f7ab3917be","source":"nvd"}],"published":"2025-12-08T00:46:21.112Z","modified":"2026-10-15T22:19:07.277Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"ec7328b59176227216c461601c6bd0e922232a9b","fixed":"e19085b2a86addccff33ab8536fc67ebd9d52198","status":"affected"},{"type":"git","introduced":"ec7328b59176227216c461601c6bd0e922232a9b","fixed":"3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8","status":"affected"},{"type":"git","introduced":"ec7328b59176227216c461601c6bd0e922232a9b","fixed":"bf3843183bc3158e5821b46f330c438ae9bd6ddb","status":"affected"},{"type":"git","introduced":"ec7328b59176227216c461601c6bd0e922232a9b","fixed":"991fbe1680cd41a5f97c92cd3a3496315df36e4b","status":"affected"},{"type":"git","introduced":"ec7328b59176227216c461601c6bd0e922232a9b","fixed":"8dca36978aa80bab9d4da130c211db75c9e00048","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.18","status":"unaffected"},{"type":"semver","introduced":"6.1.159","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.117","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.58","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.17.8","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/e19085b2a86addccff33ab8536fc67ebd9d52198","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3b60ce334c1ce8b3fad7e02dcd5ed9f6646477c8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bf3843183bc3158e5821b46f330c438ae9bd6ddb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/991fbe1680cd41a5f97c92cd3a3496315df36e4b","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8dca36978aa80bab9d4da130c211db75c9e00048","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-15T21:58:53.558Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40297","url":"https://www.cve.org/CVERecord?id=CVE-2025-40297","licence":"CVE Terms of Use","modified":"2026-10-15T22:02:42.947Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40297","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40297","licence":"Public domain","modified":"2026-10-15T22:19:07.277Z"}],"updatedAt":"2026-11-25T22:59:08.394Z","epss":{"score":0.00169,"percentile":0.06499,"date":"2026-12-01T12:00:22.000Z"}}