CVE-2024-40940 net/mlx5: Fix tainted pointer delete is case of flow rules creation fail

High 7.8 Published Updated

A use-after-free vulnerability in the Linux kernel mlx5 driver allows attackers to cause denial of service or potentially execute code via crafted flow rules.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-40940?

CVE-2024-40940 is a high-severity use after free vulnerability in Linux kernel, published on 12 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

net/mlx5: Fix tainted pointer delete is case of flow rules creation fail

In case of flow rule creation fail in mlx5_lag_create_port_sel_table(), instead of previously created rules, the tainted pointer is deleted deveral times. Fix this bug by using correct flow rules pointers.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Weakness: CWE-415

Which versions are affected by CVE-2024-40940?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-40940?

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

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-40940, DEBIAN-CVE-2024-40940, GHSA-9hw8-mm2w-94wp, UBUNTU-CVE-2024-40940.

Is CVE-2024-40940 in your software?

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

Check your SBOMs for free