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-&gt;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-&gt;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-&gt;cvq, &amp;tmp) &amp;&amp;<br /> !virtqueue_is_broken(vi-&gt;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-&gt;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.

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:*:*:*:*:*:*