CVE-2022-50063 (GCVE-0-2022-50063)
Vulnerability from cvelistv5
Published
2025-06-18 11:02
Modified
2025-06-18 11:02
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: net: dsa: felix: suppress non-changes to the tagging protocol The way in which dsa_tree_change_tag_proto() works is that when dsa_tree_notify() fails, it doesn't know whether the operation failed mid way in a multi-switch tree, or it failed for a single-switch tree. So even though drivers need to fail cleanly in ds->ops->change_tag_protocol(), DSA will still call dsa_tree_notify() again, to restore the old tag protocol for potential switches in the tree where the change did succeeed (before failing for others). This means for the felix driver that if we report an error in felix_change_tag_protocol(), we'll get another call where proto_ops == old_proto_ops. If we proceed to act upon that, we may do unexpected things. For example, we will call dsa_tag_8021q_register() twice in a row, without any dsa_tag_8021q_unregister() in between. Then we will actually call dsa_tag_8021q_unregister() via old_proto_ops->teardown, which (if it manages to run at all, after walking through corrupted data structures) will leave the ports inoperational anyway. The bug can be readily reproduced if we force an error while in tag_8021q mode; this crashes the kernel. echo ocelot-8021q > /sys/class/net/eno2/dsa/tagging echo edsa > /sys/class/net/eno2/dsa/tagging # -EPROTONOSUPPORT Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014 Call trace: vcap_entry_get+0x24/0x124 ocelot_vcap_filter_del+0x198/0x270 felix_tag_8021q_vlan_del+0xd4/0x21c dsa_switch_tag_8021q_vlan_del+0x168/0x2cc dsa_switch_event+0x68/0x1170 dsa_tree_notify+0x14/0x34 dsa_port_tag_8021q_vlan_del+0x84/0x110 dsa_tag_8021q_unregister+0x15c/0x1c0 felix_tag_8021q_teardown+0x16c/0x180 felix_change_tag_protocol+0x1bc/0x230 dsa_switch_event+0x14c/0x1170 dsa_tree_change_tag_proto+0x118/0x1c0
Impacted products
Vendor Product Version
Linux Linux Version: 7a29d220f4c0745a6d435dbd53c659fbde4998b6
Version: 7a29d220f4c0745a6d435dbd53c659fbde4998b6
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/dsa/ocelot/felix.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "8e432f157c3edc5a97a7244c666589a438f5e4d4",
              "status": "affected",
              "version": "7a29d220f4c0745a6d435dbd53c659fbde4998b6",
              "versionType": "git"
            },
            {
              "lessThan": "4c46bb49460ee14c69629e813640d8b929e88941",
              "status": "affected",
              "version": "7a29d220f4c0745a6d435dbd53c659fbde4998b6",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/dsa/ocelot/felix.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.19"
            },
            {
              "lessThan": "5.19",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.19.*",
              "status": "unaffected",
              "version": "5.19.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.0",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.19.4",
                  "versionStartIncluding": "5.19",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0",
                  "versionStartIncluding": "5.19",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet: dsa: felix: suppress non-changes to the tagging protocol\n\nThe way in which dsa_tree_change_tag_proto() works is that when\ndsa_tree_notify() fails, it doesn\u0027t know whether the operation failed\nmid way in a multi-switch tree, or it failed for a single-switch tree.\nSo even though drivers need to fail cleanly in\nds-\u003eops-\u003echange_tag_protocol(), DSA will still call dsa_tree_notify()\nagain, to restore the old tag protocol for potential switches in the\ntree where the change did succeeed (before failing for others).\n\nThis means for the felix driver that if we report an error in\nfelix_change_tag_protocol(), we\u0027ll get another call where proto_ops ==\nold_proto_ops. If we proceed to act upon that, we may do unexpected\nthings. For example, we will call dsa_tag_8021q_register() twice in a\nrow, without any dsa_tag_8021q_unregister() in between. Then we will\nactually call dsa_tag_8021q_unregister() via old_proto_ops-\u003eteardown,\nwhich (if it manages to run at all, after walking through corrupted data\nstructures) will leave the ports inoperational anyway.\n\nThe bug can be readily reproduced if we force an error while in\ntag_8021q mode; this crashes the kernel.\n\necho ocelot-8021q \u003e /sys/class/net/eno2/dsa/tagging\necho edsa \u003e /sys/class/net/eno2/dsa/tagging # -EPROTONOSUPPORT\n\nUnable to handle kernel NULL pointer dereference at virtual address 0000000000000014\nCall trace:\n vcap_entry_get+0x24/0x124\n ocelot_vcap_filter_del+0x198/0x270\n felix_tag_8021q_vlan_del+0xd4/0x21c\n dsa_switch_tag_8021q_vlan_del+0x168/0x2cc\n dsa_switch_event+0x68/0x1170\n dsa_tree_notify+0x14/0x34\n dsa_port_tag_8021q_vlan_del+0x84/0x110\n dsa_tag_8021q_unregister+0x15c/0x1c0\n felix_tag_8021q_teardown+0x16c/0x180\n felix_change_tag_protocol+0x1bc/0x230\n dsa_switch_event+0x14c/0x1170\n dsa_tree_change_tag_proto+0x118/0x1c0"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-06-18T11:02:10.473Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/8e432f157c3edc5a97a7244c666589a438f5e4d4"
        },
        {
          "url": "https://git.kernel.org/stable/c/4c46bb49460ee14c69629e813640d8b929e88941"
        }
      ],
      "title": "net: dsa: felix: suppress non-changes to the tagging protocol",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50063",
    "datePublished": "2025-06-18T11:02:10.473Z",
    "dateReserved": "2025-06-18T10:57:27.404Z",
    "dateUpdated": "2025-06-18T11:02:10.473Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50063\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-06-18T11:15:35.047\",\"lastModified\":\"2025-06-18T13:47:40.833\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnet: dsa: felix: suppress non-changes to the tagging protocol\\n\\nThe way in which dsa_tree_change_tag_proto() works is that when\\ndsa_tree_notify() fails, it doesn\u0027t know whether the operation failed\\nmid way in a multi-switch tree, or it failed for a single-switch tree.\\nSo even though drivers need to fail cleanly in\\nds-\u003eops-\u003echange_tag_protocol(), DSA will still call dsa_tree_notify()\\nagain, to restore the old tag protocol for potential switches in the\\ntree where the change did succeeed (before failing for others).\\n\\nThis means for the felix driver that if we report an error in\\nfelix_change_tag_protocol(), we\u0027ll get another call where proto_ops ==\\nold_proto_ops. If we proceed to act upon that, we may do unexpected\\nthings. For example, we will call dsa_tag_8021q_register() twice in a\\nrow, without any dsa_tag_8021q_unregister() in between. Then we will\\nactually call dsa_tag_8021q_unregister() via old_proto_ops-\u003eteardown,\\nwhich (if it manages to run at all, after walking through corrupted data\\nstructures) will leave the ports inoperational anyway.\\n\\nThe bug can be readily reproduced if we force an error while in\\ntag_8021q mode; this crashes the kernel.\\n\\necho ocelot-8021q \u003e /sys/class/net/eno2/dsa/tagging\\necho edsa \u003e /sys/class/net/eno2/dsa/tagging # -EPROTONOSUPPORT\\n\\nUnable to handle kernel NULL pointer dereference at virtual address 0000000000000014\\nCall trace:\\n vcap_entry_get+0x24/0x124\\n ocelot_vcap_filter_del+0x198/0x270\\n felix_tag_8021q_vlan_del+0xd4/0x21c\\n dsa_switch_tag_8021q_vlan_del+0x168/0x2cc\\n dsa_switch_event+0x68/0x1170\\n dsa_tree_notify+0x14/0x34\\n dsa_port_tag_8021q_vlan_del+0x84/0x110\\n dsa_tag_8021q_unregister+0x15c/0x1c0\\n felix_tag_8021q_teardown+0x16c/0x180\\n felix_change_tag_protocol+0x1bc/0x230\\n dsa_switch_event+0x14c/0x1170\\n dsa_tree_change_tag_proto+0x118/0x1c0\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net: dsa: felix: suprimir los no cambios en el protocolo de etiquetado La forma en que funciona dsa_tree_change_tag_proto() es que cuando dsa_tree_notify() falla, no sabe si la operaci\u00f3n fall\u00f3 a mitad de camino en un \u00e1rbol de m\u00faltiples conmutadores o fall\u00f3 para un \u00e1rbol de un solo conmutador. Entonces, aunque los controladores necesitan fallar limpiamente en ds-\u0026gt;ops-\u0026gt;change_tag_protocol(), DSA seguir\u00e1 llamando a dsa_tree_notify() nuevamente, para restaurar el antiguo protocolo de etiqueta para los conmutadores potenciales en el \u00e1rbol donde el cambio s\u00ed tuvo \u00e9xito (antes de fallar para otros). Esto significa para el controlador felix que si informamos de un error en felix_change_tag_protocol(), recibiremos otra llamada donde proto_ops == old_proto_ops. Si procedemos a actuar en consecuencia, podemos hacer cosas inesperadas. Por ejemplo, llamaremos a dsa_tag_8021q_register() dos veces seguidas, sin ejecutar dsa_tag_8021q_unregister() entre ambas. Luego, llamaremos a dsa_tag_8021q_unregister() mediante old_proto_ops-\u0026gt;teardown, lo cual (si logra ejecutarse, tras analizar las estructuras de datos da\u00f1adas) dejar\u00e1 los puertos inoperativos. El error se puede reproducir f\u00e1cilmente si forzamos un error en modo tag_8021q; esto provoca un fallo del kernel. echo ocelot-8021q \u0026gt; /sys/class/net/eno2/dsa/tagging echo edsa \u0026gt; /sys/class/net/eno2/dsa/tagging # -EPROTONOSUPPORT No se puede controlar la desreferencia del puntero NULL del n\u00facleo en la direcci\u00f3n virtual 0000000000000014 Rastreo de llamadas: vcap_entry_get+0x24/0x124 ocelot_vcap_filter_del+0x198/0x270 felix_tag_8021q_vlan_del+0xd4/0x21c dsa_switch_tag_8021q_vlan_del+0x168/0x2cc dsa_switch_event+0x68/0x1170 dsa_tree_notify+0x14/0x34 dsa_port_tag_8021q_vlan_del+0x84/0x110 dsa_tag_8021q_unregister+0x15c/0x1c0 felix_tag_8021q_teardown+0x16c/0x180 felix_change_tag_protocol+0x1bc/0x230 dsa_switch_event+0x14c/0x1170 dsa_tree_change_tag_proto+0x118/0x1c0\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/4c46bb49460ee14c69629e813640d8b929e88941\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/8e432f157c3edc5a97a7244c666589a438f5e4d4\",\"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…