CVE-2024-35981
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
20/05/2024
Last modified:
16/01/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
virtio_net: Do not send RSS key if it is not supported<br />
<br />
There is a bug when setting the RSS options in virtio_net that can break<br />
the whole machine, getting the kernel into an infinite loop.<br />
<br />
Running the following command in any QEMU virtual machine with virtionet<br />
will reproduce this problem:<br />
<br />
# ethtool -X eth0 hfunc toeplitz<br />
<br />
This is how the problem happens:<br />
<br />
1) ethtool_set_rxfh() calls virtnet_set_rxfh()<br />
<br />
2) virtnet_set_rxfh() calls virtnet_commit_rss_command()<br />
<br />
3) virtnet_commit_rss_command() populates 4 entries for the rss<br />
scatter-gather<br />
<br />
4) Since the command above does not have a key, then the last<br />
scatter-gatter entry will be zeroed, since rss_key_size == 0.<br />
sg_buf_size = vi->rss_key_size;<br />
<br />
5) This buffer is passed to qemu, but qemu is not happy with a buffer<br />
with zero length, and do the following in virtqueue_map_desc() (QEMU<br />
function):<br />
<br />
if (!sz) {<br />
virtio_error(vdev, "virtio: zero sized buffers are not allowed");<br />
<br />
6) virtio_error() (also QEMU function) set the device as broken<br />
<br />
vdev->broken = true;<br />
<br />
7) Qemu bails out, and do not repond this crazy kernel.<br />
<br />
8) The kernel is waiting for the response to come back (function<br />
virtnet_send_command())<br />
<br />
9) The kernel is waiting doing the following :<br />
<br />
while (!virtqueue_get_buf(vi->cvq, &tmp) &&<br />
!virtqueue_is_broken(vi->cvq))<br />
cpu_relax();<br />
<br />
10) None of the following functions above is true, thus, the kernel<br />
loops here forever. Keeping in mind that virtqueue_is_broken() does<br />
not look at the qemu `vdev->broken`, so, it never realizes that the<br />
vitio is broken at QEMU side.<br />
<br />
Fix it by not sending RSS commands if the feature is not available in<br />
the device.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.18 (including) | 6.1.90 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.29 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.8.7 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc3:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/059a49aa2e25c58f90b50151f109dd3c4cdb3a47
- https://git.kernel.org/stable/c/28e9a64638cd16bc1ecac9ff74ffeacb9fb652de
- https://git.kernel.org/stable/c/43a71c1b4b3a6d4db857b1435d271540279fc7de
- https://git.kernel.org/stable/c/539a2b995a4ed93125cb0efae0f793b00ab2158b
- https://git.kernel.org/stable/c/059a49aa2e25c58f90b50151f109dd3c4cdb3a47
- https://git.kernel.org/stable/c/28e9a64638cd16bc1ecac9ff74ffeacb9fb652de
- https://git.kernel.org/stable/c/43a71c1b4b3a6d4db857b1435d271540279fc7de
- https://git.kernel.org/stable/c/539a2b995a4ed93125cb0efae0f793b00ab2158b



