CVE-2026-72040: ipmi: fix refcount leak in i_ipmi_request()

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

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

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

ipmi: fix refcount leak in i_ipmi_request()

When a caller provides a `supplied_recv` message to i_ipmi_request(),
the function increments the user's `nr_msgs` reference count. If an
error occurs later, the out_err cleanup path only frees the recv_msg
if the function allocated it itself (i.e., !supplied_recv). In the
supplied_recv case the cleanup is skipped, leaving the reference count
elevated. The caller ipmi_request_supply_msgs() does not release the
supplied_recv on error, so the reference is permanently leaked.

Fix this by explicitly reverting the reference count operations when a
supplied recv_msg with a valid user pointer is present in the error
path: decrement nr_msgs and drop the user's kref.

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


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

	Issue introduced in 6.6.113 with commit 348121b29594d42d1635648fd3ed31dfa25351d5 and fixed in 6.6.148 with commit 9409e18ffe7378d202efe1cf69989df9f67b0369
	Issue introduced in 6.12.54 with commit 53d6e403affbf6df2c859a0ea00ccfc1e72090ca and fixed in 6.12.101 with commit e2a3b77df6aef031455dd83ea8ed4344b7dca1f9
	Issue introduced in 6.18 with commit b52da4054ee0bf9ecb44996f2c83236ff50b3812 and fixed in 6.18.40 with commit f5c5065963024390ddad51bd455d1adc710de575
	Issue introduced in 6.18 with commit b52da4054ee0bf9ecb44996f2c83236ff50b3812 and fixed in 7.1.5 with commit 0fd23994ec8c5436d9f0b50848deb87ed933e6b3
	Issue introduced in 6.18 with commit b52da4054ee0bf9ecb44996f2c83236ff50b3812 and fixed in 7.2-rc1 with commit a3f3859cecacb64f18fd446271ece9a3b3f2d4de
	Issue introduced in 6.1.157 with commit f63723ca7d7623f9dae1990973cd158671f03c56
	Issue introduced in 6.17.4 with commit 0ed73be9a2547ffb9b5c1d879ad9bfab73d920b5

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-72040
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/char/ipmi/ipmi_msghandler.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/9409e18ffe7378d202efe1cf69989df9f67b0369
	https://git.kernel.org/stable/c/e2a3b77df6aef031455dd83ea8ed4344b7dca1f9
	https://git.kernel.org/stable/c/f5c5065963024390ddad51bd455d1adc710de575
	https://git.kernel.org/stable/c/0fd23994ec8c5436d9f0b50848deb87ed933e6b3
	https://git.kernel.org/stable/c/a3f3859cecacb64f18fd446271ece9a3b3f2d4de
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.