CVE-2024-35981 (GCVE-0-2024-35981)

Vulnerability from cvelistv5 – Published: 2024-05-20 09:42 – Updated: 2025-05-04 09:09
VLAI?
Title
virtio_net: Do not send RSS key if it is not supported
Summary
In the Linux kernel, the following vulnerability has been resolved: virtio_net: Do not send RSS key if it is not supported There is a bug when setting the RSS options in virtio_net that can break the whole machine, getting the kernel into an infinite loop. Running the following command in any QEMU virtual machine with virtionet will reproduce this problem: # ethtool -X eth0 hfunc toeplitz This is how the problem happens: 1) ethtool_set_rxfh() calls virtnet_set_rxfh() 2) virtnet_set_rxfh() calls virtnet_commit_rss_command() 3) virtnet_commit_rss_command() populates 4 entries for the rss scatter-gather 4) Since the command above does not have a key, then the last scatter-gatter entry will be zeroed, since rss_key_size == 0. sg_buf_size = vi->rss_key_size; 5) This buffer is passed to qemu, but qemu is not happy with a buffer with zero length, and do the following in virtqueue_map_desc() (QEMU function): if (!sz) { virtio_error(vdev, "virtio: zero sized buffers are not allowed"); 6) virtio_error() (also QEMU function) set the device as broken vdev->broken = true; 7) Qemu bails out, and do not repond this crazy kernel. 8) The kernel is waiting for the response to come back (function virtnet_send_command()) 9) The kernel is waiting doing the following : while (!virtqueue_get_buf(vi->cvq, &tmp) && !virtqueue_is_broken(vi->cvq)) cpu_relax(); 10) None of the following functions above is true, thus, the kernel loops here forever. Keeping in mind that virtqueue_is_broken() does not look at the qemu `vdev->broken`, so, it never realizes that the vitio is broken at QEMU side. Fix it by not sending RSS commands if the feature is not available in the device.
Severity ?
No CVSS data available.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: c7114b1249fa3b5f3a434606ba4cc89c4a27d618 , < 539a2b995a4ed93125cb0efae0f793b00ab2158b (git)
Affected: c7114b1249fa3b5f3a434606ba4cc89c4a27d618 , < 43a71c1b4b3a6d4db857b1435d271540279fc7de (git)
Affected: c7114b1249fa3b5f3a434606ba4cc89c4a27d618 , < 28e9a64638cd16bc1ecac9ff74ffeacb9fb652de (git)
Affected: c7114b1249fa3b5f3a434606ba4cc89c4a27d618 , < 059a49aa2e25c58f90b50151f109dd3c4cdb3a47 (git)
Create a notification for this product.
    Linux Linux Affected: 5.18
Unaffected: 0 , < 5.18 (semver)
Unaffected: 6.1.90 , ≤ 6.1.* (semver)
Unaffected: 6.6.29 , ≤ 6.6.* (semver)
Unaffected: 6.8.7 , ≤ 6.8.* (semver)
Unaffected: 6.9 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-35981",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-20T14:22:46.032689Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:34:34.669Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T03:21:49.058Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/539a2b995a4ed93125cb0efae0f793b00ab2158b"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/43a71c1b4b3a6d4db857b1435d271540279fc7de"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/28e9a64638cd16bc1ecac9ff74ffeacb9fb652de"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/059a49aa2e25c58f90b50151f109dd3c4cdb3a47"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/virtio_net.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "539a2b995a4ed93125cb0efae0f793b00ab2158b",
              "status": "affected",
              "version": "c7114b1249fa3b5f3a434606ba4cc89c4a27d618",
              "versionType": "git"
            },
            {
              "lessThan": "43a71c1b4b3a6d4db857b1435d271540279fc7de",
              "status": "affected",
              "version": "c7114b1249fa3b5f3a434606ba4cc89c4a27d618",
              "versionType": "git"
            },
            {
              "lessThan": "28e9a64638cd16bc1ecac9ff74ffeacb9fb652de",
              "status": "affected",
              "version": "c7114b1249fa3b5f3a434606ba4cc89c4a27d618",
              "versionType": "git"
            },
            {
              "lessThan": "059a49aa2e25c58f90b50151f109dd3c4cdb3a47",
              "status": "affected",
              "version": "c7114b1249fa3b5f3a434606ba4cc89c4a27d618",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/virtio_net.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.90",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.29",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.9",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.90",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.29",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.8.7",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.9",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nvirtio_net: Do not send RSS key if it is not supported\n\nThere is a bug when setting the RSS options in virtio_net that can break\nthe whole machine, getting the kernel into an infinite loop.\n\nRunning the following command in any QEMU virtual machine with virtionet\nwill reproduce this problem:\n\n    # ethtool -X eth0  hfunc toeplitz\n\nThis is how the problem happens:\n\n1) ethtool_set_rxfh() calls virtnet_set_rxfh()\n\n2) virtnet_set_rxfh() calls virtnet_commit_rss_command()\n\n3) virtnet_commit_rss_command() populates 4 entries for the rss\nscatter-gather\n\n4) Since the command above does not have a key, then the last\nscatter-gatter entry will be zeroed, since rss_key_size == 0.\nsg_buf_size = vi-\u003erss_key_size;\n\n5) This buffer is passed to qemu, but qemu is not happy with a buffer\nwith zero length, and do the following in virtqueue_map_desc() (QEMU\nfunction):\n\n  if (!sz) {\n      virtio_error(vdev, \"virtio: zero sized buffers are not allowed\");\n\n6) virtio_error() (also QEMU function) set the device as broken\n\n    vdev-\u003ebroken = true;\n\n7) Qemu bails out, and do not repond this crazy kernel.\n\n8) The kernel is waiting for the response to come back (function\nvirtnet_send_command())\n\n9) The kernel is waiting doing the following :\n\n      while (!virtqueue_get_buf(vi-\u003ecvq, \u0026tmp) \u0026\u0026\n\t     !virtqueue_is_broken(vi-\u003ecvq))\n\t      cpu_relax();\n\n10) None of the following functions above is true, thus, the kernel\nloops here forever. Keeping in mind that virtqueue_is_broken() does\nnot look at the qemu `vdev-\u003ebroken`, so, it never realizes that the\nvitio is broken at QEMU side.\n\nFix it by not sending RSS commands if the feature is not available in\nthe device."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T09:09:47.538Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/539a2b995a4ed93125cb0efae0f793b00ab2158b"
        },
        {
          "url": "https://git.kernel.org/stable/c/43a71c1b4b3a6d4db857b1435d271540279fc7de"
        },
        {
          "url": "https://git.kernel.org/stable/c/28e9a64638cd16bc1ecac9ff74ffeacb9fb652de"
        },
        {
          "url": "https://git.kernel.org/stable/c/059a49aa2e25c58f90b50151f109dd3c4cdb3a47"
        }
      ],
      "title": "virtio_net: Do not send RSS key if it is not supported",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-35981",
    "datePublished": "2024-05-20T09:42:05.722Z",
    "dateReserved": "2024-05-17T13:50:33.144Z",
    "dateUpdated": "2025-05-04T09:09:47.538Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/539a2b995a4ed93125cb0efae0f793b00ab2158b\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/43a71c1b4b3a6d4db857b1435d271540279fc7de\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/28e9a64638cd16bc1ecac9ff74ffeacb9fb652de\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/059a49aa2e25c58f90b50151f109dd3c4cdb3a47\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T03:21:49.058Z\"}}, {\"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-35981\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-05-20T14:22:46.032689Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-05-23T19:01:24.834Z\"}, \"title\": \"CISA ADP Vulnrichment\"}], \"cna\": {\"title\": \"virtio_net: Do not send RSS key if it is not supported\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"c7114b1249fa3b5f3a434606ba4cc89c4a27d618\", \"lessThan\": \"539a2b995a4ed93125cb0efae0f793b00ab2158b\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"c7114b1249fa3b5f3a434606ba4cc89c4a27d618\", \"lessThan\": \"43a71c1b4b3a6d4db857b1435d271540279fc7de\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"c7114b1249fa3b5f3a434606ba4cc89c4a27d618\", \"lessThan\": \"28e9a64638cd16bc1ecac9ff74ffeacb9fb652de\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"c7114b1249fa3b5f3a434606ba4cc89c4a27d618\", \"lessThan\": \"059a49aa2e25c58f90b50151f109dd3c4cdb3a47\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/net/virtio_net.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.18\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.18\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.1.90\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.1.*\"}, {\"status\": \"unaffected\", \"version\": \"6.6.29\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.8.7\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.8.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/net/virtio_net.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/539a2b995a4ed93125cb0efae0f793b00ab2158b\"}, {\"url\": \"https://git.kernel.org/stable/c/43a71c1b4b3a6d4db857b1435d271540279fc7de\"}, {\"url\": \"https://git.kernel.org/stable/c/28e9a64638cd16bc1ecac9ff74ffeacb9fb652de\"}, {\"url\": \"https://git.kernel.org/stable/c/059a49aa2e25c58f90b50151f109dd3c4cdb3a47\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nvirtio_net: Do not send RSS key if it is not supported\\n\\nThere is a bug when setting the RSS options in virtio_net that can break\\nthe whole machine, getting the kernel into an infinite loop.\\n\\nRunning the following command in any QEMU virtual machine with virtionet\\nwill reproduce this problem:\\n\\n    # ethtool -X eth0  hfunc toeplitz\\n\\nThis is how the problem happens:\\n\\n1) ethtool_set_rxfh() calls virtnet_set_rxfh()\\n\\n2) virtnet_set_rxfh() calls virtnet_commit_rss_command()\\n\\n3) virtnet_commit_rss_command() populates 4 entries for the rss\\nscatter-gather\\n\\n4) Since the command above does not have a key, then the last\\nscatter-gatter entry will be zeroed, since rss_key_size == 0.\\nsg_buf_size = vi-\u003erss_key_size;\\n\\n5) This buffer is passed to qemu, but qemu is not happy with a buffer\\nwith zero length, and do the following in virtqueue_map_desc() (QEMU\\nfunction):\\n\\n  if (!sz) {\\n      virtio_error(vdev, \\\"virtio: zero sized buffers are not allowed\\\");\\n\\n6) virtio_error() (also QEMU function) set the device as broken\\n\\n    vdev-\u003ebroken = true;\\n\\n7) Qemu bails out, and do not repond this crazy kernel.\\n\\n8) The kernel is waiting for the response to come back (function\\nvirtnet_send_command())\\n\\n9) The kernel is waiting doing the following :\\n\\n      while (!virtqueue_get_buf(vi-\u003ecvq, \u0026tmp) \u0026\u0026\\n\\t     !virtqueue_is_broken(vi-\u003ecvq))\\n\\t      cpu_relax();\\n\\n10) None of the following functions above is true, thus, the kernel\\nloops here forever. Keeping in mind that virtqueue_is_broken() does\\nnot look at the qemu `vdev-\u003ebroken`, so, it never realizes that the\\nvitio is broken at QEMU side.\\n\\nFix it by not sending RSS commands if the feature is not available in\\nthe device.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.1.90\", \"versionStartIncluding\": \"5.18\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6.29\", \"versionStartIncluding\": \"5.18\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.8.7\", \"versionStartIncluding\": \"5.18\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.9\", \"versionStartIncluding\": \"5.18\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-05-04T09:09:47.538Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-35981\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-05-04T09:09:47.538Z\", \"dateReserved\": \"2024-05-17T13:50:33.144Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-20T09:42:05.722Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


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 observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…