CVE-2025-37865 (GCVE-0-2025-37865)
Vulnerability from cvelistv5
Published
2025-05-09 06:43
Modified
2025-05-26 05:22
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: net: dsa: mv88e6xxx: fix -ENOENT when deleting VLANs and MST is unsupported Russell King reports that on the ZII dev rev B, deleting a bridge VLAN from a user port fails with -ENOENT: https://lore.kernel.org/netdev/Z_lQXNP0s5-IiJzd@shell.armlinux.org.uk/ This comes from mv88e6xxx_port_vlan_leave() -> mv88e6xxx_mst_put(), which tries to find an MST entry in &chip->msts associated with the SID, but fails and returns -ENOENT as such. But we know that this chip does not support MST at all, so that is not surprising. The question is why does the guard in mv88e6xxx_mst_put() not exit early: if (!sid) return 0; And the answer seems to be simple: the sid comes from vlan.sid which supposedly was previously populated by mv88e6xxx_vtu_get(). But some chip->info->ops->vtu_getnext() implementations do not populate vlan.sid, for example see mv88e6185_g1_vtu_getnext(). In that case, later in mv88e6xxx_port_vlan_leave() we are using a garbage sid which is just residual stack memory. Testing for sid == 0 covers all cases of a non-bridge VLAN or a bridge VLAN mapped to the default MSTI. For some chips, SID 0 is valid and installed by mv88e6xxx_stu_setup(). A chip which does not support the STU would implicitly only support mapping all VLANs to the default MSTI, so although SID 0 is not valid, it would be sufficient, if we were to zero-initialize the vlan structure, to fix the bug, due to the coincidence that a test for vlan.sid == 0 already exists and leads to the same (correct) behavior. Another option which would be sufficient would be to add a test for mv88e6xxx_has_stu() inside mv88e6xxx_mst_put(), symmetric to the one which already exists in mv88e6xxx_mst_get(). But that placement means the caller will have to dereference vlan.sid, which means it will access uninitialized memory, which is not nice even if it ignores it later. So we end up making both modifications, in order to not rely just on the sid == 0 coincidence, but also to avoid having uninitialized structure fields which might get temporarily accessed.
Impacted products
Vendor Product Version
Linux Linux Version: acaf4d2e36b3466334af4d3ee6ac254c3316165c
Version: acaf4d2e36b3466334af4d3ee6ac254c3316165c
Version: acaf4d2e36b3466334af4d3ee6ac254c3316165c
Version: acaf4d2e36b3466334af4d3ee6ac254c3316165c
Version: acaf4d2e36b3466334af4d3ee6ac254c3316165c
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/dsa/mv88e6xxx/chip.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "35cde75c08a1fa1a5ac0467afe2709caceeef002",
              "status": "affected",
              "version": "acaf4d2e36b3466334af4d3ee6ac254c3316165c",
              "versionType": "git"
            },
            {
              "lessThan": "afae9087301471970254a9180e5a26d3d8e8af09",
              "status": "affected",
              "version": "acaf4d2e36b3466334af4d3ee6ac254c3316165c",
              "versionType": "git"
            },
            {
              "lessThan": "9ee6d3a368ed34f2457863da3085c676e9e37a3d",
              "status": "affected",
              "version": "acaf4d2e36b3466334af4d3ee6ac254c3316165c",
              "versionType": "git"
            },
            {
              "lessThan": "9da4acbd60664271d34a627f7f63cd5bad8eba74",
              "status": "affected",
              "version": "acaf4d2e36b3466334af4d3ee6ac254c3316165c",
              "versionType": "git"
            },
            {
              "lessThan": "ea08dfc35f83cfc73493c52f63ae4f2e29edfe8d",
              "status": "affected",
              "version": "acaf4d2e36b3466334af4d3ee6ac254c3316165c",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/dsa/mv88e6xxx/chip.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.18"
            },
            {
              "lessThan": "5.18",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.135",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.88",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.25",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.14.*",
              "status": "unaffected",
              "version": "6.14.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.15",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.135",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.88",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.25",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14.4",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet: dsa: mv88e6xxx: fix -ENOENT when deleting VLANs and MST is unsupported\n\nRussell King reports that on the ZII dev rev B, deleting a bridge VLAN\nfrom a user port fails with -ENOENT:\nhttps://lore.kernel.org/netdev/Z_lQXNP0s5-IiJzd@shell.armlinux.org.uk/\n\nThis comes from mv88e6xxx_port_vlan_leave() -\u003e mv88e6xxx_mst_put(),\nwhich tries to find an MST entry in \u0026chip-\u003emsts associated with the SID,\nbut fails and returns -ENOENT as such.\n\nBut we know that this chip does not support MST at all, so that is not\nsurprising. The question is why does the guard in mv88e6xxx_mst_put()\nnot exit early:\n\n\tif (!sid)\n\t\treturn 0;\n\nAnd the answer seems to be simple: the sid comes from vlan.sid which\nsupposedly was previously populated by mv88e6xxx_vtu_get().\nBut some chip-\u003einfo-\u003eops-\u003evtu_getnext() implementations do not populate\nvlan.sid, for example see mv88e6185_g1_vtu_getnext(). In that case,\nlater in mv88e6xxx_port_vlan_leave() we are using a garbage sid which is\njust residual stack memory.\n\nTesting for sid == 0 covers all cases of a non-bridge VLAN or a bridge\nVLAN mapped to the default MSTI. For some chips, SID 0 is valid and\ninstalled by mv88e6xxx_stu_setup(). A chip which does not support the\nSTU would implicitly only support mapping all VLANs to the default MSTI,\nso although SID 0 is not valid, it would be sufficient, if we were to\nzero-initialize the vlan structure, to fix the bug, due to the\ncoincidence that a test for vlan.sid == 0 already exists and leads to\nthe same (correct) behavior.\n\nAnother option which would be sufficient would be to add a test for\nmv88e6xxx_has_stu() inside mv88e6xxx_mst_put(), symmetric to the one\nwhich already exists in mv88e6xxx_mst_get(). But that placement means\nthe caller will have to dereference vlan.sid, which means it will access\nuninitialized memory, which is not nice even if it ignores it later.\n\nSo we end up making both modifications, in order to not rely just on the\nsid == 0 coincidence, but also to avoid having uninitialized structure\nfields which might get temporarily accessed."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-26T05:22:35.989Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/35cde75c08a1fa1a5ac0467afe2709caceeef002"
        },
        {
          "url": "https://git.kernel.org/stable/c/afae9087301471970254a9180e5a26d3d8e8af09"
        },
        {
          "url": "https://git.kernel.org/stable/c/9ee6d3a368ed34f2457863da3085c676e9e37a3d"
        },
        {
          "url": "https://git.kernel.org/stable/c/9da4acbd60664271d34a627f7f63cd5bad8eba74"
        },
        {
          "url": "https://git.kernel.org/stable/c/ea08dfc35f83cfc73493c52f63ae4f2e29edfe8d"
        }
      ],
      "title": "net: dsa: mv88e6xxx: fix -ENOENT when deleting VLANs and MST is unsupported",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-37865",
    "datePublished": "2025-05-09T06:43:55.486Z",
    "dateReserved": "2025-04-16T04:51:23.958Z",
    "dateUpdated": "2025-05-26T05:22:35.989Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-37865\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-05-09T07:16:07.530\",\"lastModified\":\"2025-05-12T17:32:32.760\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet: dsa: mv88e6xxx: fix -ENOENT when deleting VLANs and MST is unsupported\\n\\nRussell King reports that on the ZII dev rev B, deleting a bridge VLAN\\nfrom a user port fails with -ENOENT:\\nhttps://lore.kernel.org/netdev/Z_lQXNP0s5-IiJzd@shell.armlinux.org.uk/\\n\\nThis comes from mv88e6xxx_port_vlan_leave() -\u003e mv88e6xxx_mst_put(),\\nwhich tries to find an MST entry in \u0026chip-\u003emsts associated with the SID,\\nbut fails and returns -ENOENT as such.\\n\\nBut we know that this chip does not support MST at all, so that is not\\nsurprising. The question is why does the guard in mv88e6xxx_mst_put()\\nnot exit early:\\n\\n\\tif (!sid)\\n\\t\\treturn 0;\\n\\nAnd the answer seems to be simple: the sid comes from vlan.sid which\\nsupposedly was previously populated by mv88e6xxx_vtu_get().\\nBut some chip-\u003einfo-\u003eops-\u003evtu_getnext() implementations do not populate\\nvlan.sid, for example see mv88e6185_g1_vtu_getnext(). In that case,\\nlater in mv88e6xxx_port_vlan_leave() we are using a garbage sid which is\\njust residual stack memory.\\n\\nTesting for sid == 0 covers all cases of a non-bridge VLAN or a bridge\\nVLAN mapped to the default MSTI. For some chips, SID 0 is valid and\\ninstalled by mv88e6xxx_stu_setup(). A chip which does not support the\\nSTU would implicitly only support mapping all VLANs to the default MSTI,\\nso although SID 0 is not valid, it would be sufficient, if we were to\\nzero-initialize the vlan structure, to fix the bug, due to the\\ncoincidence that a test for vlan.sid == 0 already exists and leads to\\nthe same (correct) behavior.\\n\\nAnother option which would be sufficient would be to add a test for\\nmv88e6xxx_has_stu() inside mv88e6xxx_mst_put(), symmetric to the one\\nwhich already exists in mv88e6xxx_mst_get(). But that placement means\\nthe caller will have to dereference vlan.sid, which means it will access\\nuninitialized memory, which is not nice even if it ignores it later.\\n\\nSo we end up making both modifications, in order to not rely just on the\\nsid == 0 coincidence, but also to avoid having uninitialized structure\\nfields which might get temporarily accessed.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net: dsa: mv88e6xxx: correcci\u00f3n de -ENOENT al eliminar VLAN y MST no es compatible Russell King informa que en ZII dev rev B, la eliminaci\u00f3n de una VLAN de puente de un puerto de usuario falla con -ENOENT: https://lore.kernel.org/netdev/Z_lQXNP0s5-IiJzd@shell.armlinux.org.uk/ Esto viene de mv88e6xxx_port_vlan_leave() -\u0026gt; mv88e6xxx_mst_put(), que intenta encontrar una entrada MST en \u0026amp;chip-\u0026gt;msts asociada con el SID, pero falla y devuelve -ENOENT como tal. Pero sabemos que este chip no admite MST en absoluto, por lo que no es sorprendente. La pregunta es por qu\u00e9 la protecci\u00f3n en mv88e6xxx_mst_put() no sale antes: if (!sid) return 0; La respuesta parece sencilla: el SID proviene de vlan.sid, que supuestamente se rellenaba previamente con mv88e6xxx_vtu_get(). Sin embargo, algunas implementaciones de chip-\u0026gt;info-\u0026gt;ops-\u0026gt;vtu_getnext() no rellenan vlan.sid; por ejemplo, v\u00e9ase mv88e6185_g1_vtu_getnext(). En ese caso, m\u00e1s adelante en mv88e6xxx_port_vlan_leave(), usamos un SID no v\u00e1lido, que es simplemente memoria de pila residual. La prueba de sid == 0 cubre todos los casos de una VLAN sin puente o una VLAN de puente asignada al MSTI predeterminado. Para algunos chips, el SID 0 es v\u00e1lido y se instala con mv88e6xxx_stu_setup(). Un chip que no admita la STU solo permitir\u00eda, impl\u00edcitamente, la asignaci\u00f3n de todas las VLAN al MSTI predeterminado. Por lo tanto, aunque el SID 0 no es v\u00e1lido, bastar\u00eda con inicializar a cero la estructura de la VLAN para corregir el error, debido a la coincidencia de que ya existe una prueba para vlan.sid == 0 que produce el mismo comportamiento (correcto). Otra opci\u00f3n suficiente ser\u00eda a\u00f1adir una prueba para mv88e6xxx_has_stu() dentro de mv88e6xxx_mst_put(), sim\u00e9trica a la existente en mv88e6xxx_mst_get(). Sin embargo, esta ubicaci\u00f3n implica que el emisor tendr\u00e1 que desreferenciar vlan.sid, lo que implica acceder a memoria no inicializada, lo cual no es conveniente incluso si lo ignora posteriormente. Por lo tanto, realizamos ambas modificaciones para no depender solo de la coincidencia de sid == 0, sino tambi\u00e9n para evitar tener campos de estructura sin inicializar a los que se pueda acceder temporalmente.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/35cde75c08a1fa1a5ac0467afe2709caceeef002\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9da4acbd60664271d34a627f7f63cd5bad8eba74\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9ee6d3a368ed34f2457863da3085c676e9e37a3d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/afae9087301471970254a9180e5a26d3d8e8af09\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/ea08dfc35f83cfc73493c52f63ae4f2e29edfe8d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…