CVE-2024-42108 net: rswitch: Avoid use-after-free in rswitch_poll()

Critical 9.8 Published Updated

A use-after-free in the rswitch network driver allows attackers to cause a system crash or potentially execute code via simple network packets.

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

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

net: rswitch: Avoid use-after-free in rswitch_poll()

The use-after-free is actually in rswitch_tx_free(), which is inlined in rswitch_poll(). Since `skb` and `gq->skbs[gq->dirty]` are in fact the same pointer, the skb is first freed using dev_kfree_skb_any(), then the value in skb->len is used to update the interface statistics.

Let's move around the instructions to use skb->len before the skb is freed.

This bug is trivial to reproduce using KFENCE. It will trigger a splat every few packets. A simple ARP request or ICMP echo request is enough.

Weakness: CWE-416

Which versions are affected by CVE-2024-42108?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-42108?

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-42108 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-42108, DEBIAN-CVE-2024-42108, GHSA-g3v7-q58w-w9qx, UBUNTU-CVE-2024-42108.

Is CVE-2024-42108 in your software?

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

Check your SBOMs for free