CVE-2024-35981: virtio_net: Do not send RSS key if it is not supported

Published May 20, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

virtionet: Do not send RSS key if it is not supported

There is a bug when setting the RSS options in virtionet 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) ethtoolsetrxfh() calls virtnetsetrxfh()

2) virtnetsetrxfh() calls virtnetcommitrsscommand()

3) virtnetcommitrsscommand() 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 rsskeysize == 0. sgbufsize = vi->rsskeysize;

5) This buffer is passed to qemu, but qemu is not happy with a buffer with zero length, and do the following in virtqueuemapdesc() (QEMU function):

if (!sz) { virtioerror(vdev, "virtio: zero sized buffers are not allowed");

6) virtioerror() (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 virtnetsendcommand())

9) The kernel is waiting doing the following :

while (!virtqueuegetbuf(vi->cvq, &tmp) && !virtqueueisbroken(vi->cvq)) cpurelax();

10) None of the following functions above is true, thus, the kernel loops here forever. Keeping in mind that virtqueueisbroken() 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.

Affected Software

7 affected componentsFixes available
Linux Linux kernel>=5.18<6.1.90
Linux Linux kernel>=6.2<6.6.29
Linux Linux kernel>=6.7<6.8.7
Linux Linux kernel=6.9-rc1
Linux Linux kernel=6.9-rc2
Linux Linux kernel=6.9-rc3
debian/linux
5.10.223-15.10.234-16.1.129-16.1.133-16.12.22-16.12.25-1

Event History

May 20, 2024
CVE Published
via MITRE·09:42 AM
Data Sourced
via MITRE·09:42 AM
Description
Jul 11, 2024
Data Sourced
via Launchpad·07:49 PM
Description
Jan 23, 2025
Data Sourced
via Ubuntu·08:48 PM
RemedyDescriptionSeverityAffected Software
Apr 27, 2025
Data Sourced
via Debian·12:26 AM
DescriptionAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35981?

CVE-2024-35981 has been classified as a medium severity vulnerability due to its potential to cause kernel crashes.

2

How do I fix CVE-2024-35981?

To resolve CVE-2024-35981, upgrade the Linux kernel to versions 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.128-1, or 6.12.12-1.

3

Which systems are affected by CVE-2024-35981?

CVE-2024-35981 affects multiple versions of the Linux kernel, specifically between versions 5.18 and 6.6.29, as well as versions 6.7 to 6.8.7 and 6.9 release candidates.

4

What is the cause of CVE-2024-35981?

CVE-2024-35981 is caused by a bug in the virtio_net driver related to RSS options that can lead to an infinite loop in the kernel.

5

Is there any workaround for CVE-2024-35981?

Currently, the best approach to mitigate CVE-2024-35981 is to apply the necessary kernel updates as there are no specific workarounds available.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203