CVE-2024-42285 RDMA/iwcm: Fix a use-after-free related to destroying CM IDs

Critical 9.8 Published Updated

A use-after-free vulnerability in the Linux kernel RDMA subsystem allows attackers to potentially execute arbitrary code or escalate privileges.

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

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

RDMA/iwcm: Fix a use-after-free related to destroying CM IDs

iw_conn_req_handler() associates a new struct rdma_id_private (conn_id) with an existing struct iw_cm_id (cm_id) as follows:

conn_id->cm_id.iw = cm_id; cm_id->context = conn_id; cm_id->cm_handler = cma_iw_handler;

rdma_destroy_id() frees both the cm_id and the struct rdma_id_private. Make sure that cm_work_handler() does not trigger a use-after-free by only freeing of the struct rdma_id_private after all pending work has finished.

Weakness: CWE-416

Which versions are affected by CVE-2024-42285?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-42285?

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

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-47825, AZL-47847, BELL-CVE-2024-42285, DEBIAN-CVE-2024-42285, GHSA-x7mx-xj8x-r7p3, UBUNTU-CVE-2024-42285.

Is CVE-2024-42285 in your software?

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

Check your SBOMs for free