Skip to contentSkip to conversation

CVE-2026-23322: ipmi: Fix use-after-free and list corruption on sender error

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Mar 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

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

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

ipmi: Fix use-after-free and list corruption on sender error

The analysis from Breno:

When the SMI sender returns an error, smi_work() delivers an error response but then jumps back to restart without cleaning up properly:

1. intf->curr_msg is not cleared, so no new message is pulled
2. newmsg still points to the message, causing sender() to be called again with the same message
3. If sender() fails again, deliver_err_response() is called with the same recv_msg that was already queued for delivery

This causes list_add corruption ("list_add double add") because the recv_msg is added to the user_msgs list twice. Subsequently, the corrupted list leads to use-after-free when the memory is freed and reused, and eventually a NULL pointer dereference when accessing recv_msg->done.

The buggy sequence:

sender() fails

    -> deliver_err_response(recv_msg)  // recv_msg queued for delivery
    -> goto restart                    // curr_msg not cleared!
  sender() fails again (same message!)
    -> deliver_err_response(recv_msg)  // tries to queue same recv_msg
    -> LIST CORRUPTION

Fix this by freeing the message and setting it to NULL on a send error. Also, always free the newmsg on a send error, otherwise it will leak.

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

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

	Issue introduced in 6.18 with commit 9cf93a8fa9513c6d3cc65bdd50e05c1355cef322 and fixed in 6.18.17 with commit c08ec55617cb9674a060a3392ea08391ab2a4f74
	Issue introduced in 6.18 with commit 9cf93a8fa9513c6d3cc65bdd50e05c1355cef322 and fixed in 6.19.7 with commit 65ff5d1e4410df05edfbeb7bf2d62f7681ce1d53
	Issue introduced in 6.18 with commit 9cf93a8fa9513c6d3cc65bdd50e05c1355cef322 and fixed in 7.0-rc2 with commit 594c11d0e1d445f580898a2b8c850f2e3f099368

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-23322

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/c08ec55617cb9674a060a3392ea08391ab2a4f74
	https://git.kernel.org/stable/c/65ff5d1e4410df05edfbeb7bf2d62f7681ce1d53
	https://git.kernel.org/stable/c/594c11d0e1d445f580898a2b8c850f2e3f099368