CVE-2026-74405: OPP: Fix race between OPP addition and lookup

Greg Kroah-Hartman <[email protected]>
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026081509-CVE-2026-74405-fed2@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

OPP: Fix race between OPP addition and lookup

A race exists between dev_pm_opp_add_dynamic() and
dev_pm_opp_find_freq_exact():

  CPU0 (add)                          CPU1 (lookup)
  -------------------------------     ------------------------------
  _opp_add()
    mutex_lock()
    list_add(&new_opp->node, head)
    mutex_unlock()                    _opp_table_find_key()
                                        mutex_lock()
                                        dev_pm_opp_get(opp)
                                          kref_get()
                                        mutex_unlock()
    kref_init(&new_opp->kref)
                                      dev_pm_opp_put()
                                        kref_put_mutex()

The newly added OPP is inserted into the list before its kref is
initialized. A concurrent lookup can find this OPP and increment its
reference count while it is still uninitialized, leading to refcount
corruption and a potential premature free.

Fix this by initializing ->kref and ->opp_table before making the OPP
visible via list_add(). This ensures any concurrent lookup observes a
fully initialized object.

[ Viresh: Updated commit log ]

The Linux kernel CVE team has assigned CVE-2026-74405 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 4.11 with commit 7034764a1e4a6edbb60914e89aad8384e3fe5d17 and fixed in 6.18.40 with commit 46696b0b2123475d7f95909435c09808fc5ffd23
	Issue introduced in 4.11 with commit 7034764a1e4a6edbb60914e89aad8384e3fe5d17 and fixed in 7.1.5 with commit bb75bd7d9ae7672034f73ce67a57e6ac89bb39e5
	Issue introduced in 4.11 with commit 7034764a1e4a6edbb60914e89aad8384e3fe5d17 and fixed in 7.2-rc1 with commit f5e1cc9a284bff2510981643a5bca4bc4c21b81a

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-74405
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	drivers/opp/core.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/46696b0b2123475d7f95909435c09808fc5ffd23
	https://git.kernel.org/stable/c/bb75bd7d9ae7672034f73ce67a57e6ac89bb39e5
	https://git.kernel.org/stable/c/f5e1cc9a284bff2510981643a5bca4bc4c21b81a
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.