CVE-2024-27005 interconnect: Don't access req_list while it's being manipulated

High 7.8 Published Updated

A race condition in the Linux kernel interconnect subsystem allows invalid pointer access, potentially causing system crashes or denial of service.

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

CVE-2024-27005 is a high-severity vulnerability in Linux kernel, published on 1 May 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:

interconnect: Don't access req_list while it's being manipulated

The icc_lock mutex was split into separate icc_lock and icc_bw_lock mutexes in [1] to avoid lockdep splats. However, this didn't adequately protect access to icc_node::req_list.

The icc_set_bw() function will eventually iterate over req_list while only holding icc_bw_lock, but req_list can be modified while only holding icc_lock. This causes races between icc_set_bw(), of_icc_get(), and icc_put().

Example A:

CPU0 CPU1 ---- ---- icc_set_bw(path_a) mutex_lock(&icc_bw_lock); icc_put(path_b) mutex_lock(&icc_lock); aggregate_requests() hlist_for_each_entry(r, ... hlist_del(... <r = invalid pointer>

Example B:

CPU0 CPU1 ---- ---- icc_set_bw(path_a) mutex_lock(&icc_bw_lock); path_b = of_icc_get() of_icc_get_by_index() mutex_lock(&icc_lock); path_find() path_init() aggregate_requests() hlist_for_each_entry(r, ... hlist_add_head(... <r = invalid pointer>

Fix this by ensuring icc_bw_lock is always held before manipulating icc_node::req_list. The additional places icc_bw_lock is held don't perform any memory allocations, so we should still be safe from the original lockdep splats that motivated the separate locks.

[1] commit af42269c3523 ("interconnect: Fix locking for runpm vs reclaim")

Weakness: CWE-667, CWE-362

Which versions are affected by CVE-2024-27005?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-27005?

Apply the vendor's patch.

Is CVE-2024-27005 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-59644, BELL-CVE-2024-27005, DEBIAN-CVE-2024-27005, GHSA-p672-9qr7-4cmf, ROOT-OS-DEBIAN-12-CVE-2024-27005, ROOT-OS-UBUNTU-2204-CVE-2024-27005 and 1 more.

Is CVE-2024-27005 in your software?

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

Check your SBOMs for free