CVE-2024-35981
virtio_net: Do not send RSS key if it is not supported
Reported by linux · Published May 20, 2024
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel-headers | Amazon Linux | 6.1.90-99.173.amzn2023 |
| bpftool | Amazon Linux | 6.1.90-99.173.amzn2023 |
| linux_kernel | linux | 6.8.7, 6.6.29, 6.1.90 |
| Linux | Linux | 539a2b995a4ed93125cb0efae0f793b00ab2158b, 43a71c1b4b3a6d4db857b1435d271540279fc7de, 28e9a64638cd16bc1ecac9ff74ffeacb9fb652de, 059a49aa2e25c58f90b50151f109dd3c4cdb3a47 |
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | c7114b1249fa3b5f3a434606ba4cc89c4a27d618, c7114b1249fa3b5f3a434606ba4cc89c4a27d618, c7114b1249fa3b5f3a434606ba4cc89c4a27d618 |
| Linux | Linux | 5.18, 0, 6.1.90 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | bpftool | 0 |
| Linux | Linux | 6.8.7, *, 6.9 |
| amazon:2023 | kernel-livepatch-6.1.90-99.173 | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| linux | linux_kernel | 5.18, 5.18, 5.18 |
Timeline
- May 20, 2024 CVE Published
- May 21, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (6 in total, the first dated here)
- Jan 10, 2026 Security Advisory (436 in total, the first dated here)
- Mar 30, 2026 Distribution Patch (331 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-35981
vulnetix vdb fixes CVE-2024-35981
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-35981/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart