CVE-2024-40937 gve: Clear napi->skb before dev_kfree_skb_any()

Critical 9.8 Published Updated

A use-after-free vulnerability in the Linux kernel gve driver allows attackers to cause a denial of service or potentially execute code via dangling pointers.

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-40937?

CVE-2024-40937 is a critical use after free vulnerability in Linux kernel, published on 12 Jul 2024. 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:

gve: Clear napi->skb before dev_kfree_skb_any()

gve_rx_free_skb incorrectly leaves napi->skb referencing an skb after it is freed with dev_kfree_skb_any(). This can result in a subsequent call to napi_get_frags returning a dangling pointer.

Fix this by clearing napi->skb before the skb is freed.

Which versions are affected by CVE-2024-40937?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-40937?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2024-40937 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-40937, DEBIAN-CVE-2024-40937, GHSA-wcgf-w2rg-3g4r, UBUNTU-CVE-2024-40937.

Is CVE-2024-40937 in your software?

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

Check your SBOMs for free