CVE-2024-57843 virtio-net: fix overflow inside virtnet_rq_alloc

Critical 9.8 Published Updated

An integer overflow in the Linux kernel virtio-net driver can cause system crashes or denial of service when specific network allocation settings are enabled.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-57843?

CVE-2024-57843 is a critical vulnerability in Linux kernel, published on 11 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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

virtio-net: fix overflow inside virtnet_rq_alloc

When the frag just got a page, then may lead to regression on VM. Specially if the sysctl net.core.high_order_alloc_disable value is 1, then the frag always get a page when do refill.

Which could see reliable crashes or scp failure (scp a file 100M in size to VM).

The issue is that the virtnet_rq_dma takes up 16 bytes at the beginning of a new frag. When the frag size is larger than PAGE_SIZE, everything is fine. However, if the frag is only one page and the total size of the buffer and virtnet_rq_dma is larger than one page, an overflow may occur.

The commit f9dac92ba908 ("virtio_ring: enable premapped mode whatever use_dma_api") introduced this problem. And we reverted some commits to fix this in last linux version. Now we try to enable it and fix this bug directly.

Here, when the frag size is not enough, we reduce the buffer len to fix this problem.

Weakness: CWE-191

Which versions are affected by CVE-2024-57843?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-57843?

Apply the vendor's patch.

Is CVE-2024-57843 being exploited?

There is no known exploitation of CVE-2024-57843 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as AZL-67779, BELL-CVE-2024-57843, DEBIAN-CVE-2024-57843, GHSA-rvwg-gc58-2352, ROOT-OS-DEBIAN-11-CVE-2024-57843, ROOT-OS-DEBIAN-12-CVE-2024-57843 and 2 more.

Is CVE-2024-57843 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free