CVE-2026-64222: octeontx2-pf: avoid double free of pool->stack on AQ init failure

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

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

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

octeontx2-pf: avoid double free of pool->stack on AQ init failure

otx2_pool_aq_init() frees pool->stack when mailbox sync or retry
allocation fails, but leaves the pointer unchanged. Later,
otx2_sq_aura_pool_init() unwinds the partial setup through
otx2_aura_pool_free(), which frees pool->stack again. The CN20K-specific
cn20k_pool_aq_init() implementation has the same bug in
its corresponding error path.

Set pool->stack to NULL immediately after the local free so the shared
cleanup path does not free the same stack again while cleaning up
partially initialized pool state.

The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still present in
v7.1-rc3.

Runtime validation was not performed because reproducing this path
requires OcteonTX2/CN20K hardware.

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


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

	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 5.10.259 with commit e6e9bc0bf963662b7042048ab0281014625d4cb4
	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 5.15.210 with commit b92e7ea408b6f1144648909c9c49a55d245d7300
	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 6.1.176 with commit 94192b0579333c3deee2441379aab8ca98fc2e6b
	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 6.6.143 with commit 4c29603498b05c049dbbbc47e882f2fbf0193cd7
	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 6.12.93 with commit 0488a0bb344fb1992853b60082acff6be8164d74
	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 6.18.35 with commit 0d9b9d7dbef976ae7f855b6358f1d703014e96ea
	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 7.0.11 with commit c4b8c5d51632538b19ee01cf6d70cbceeefbd3ec
	Issue introduced in 5.6 with commit caa2da34fd25a37e9fd43343b6966fb9d730a6d5 and fixed in 7.1 with commit 9b244c242bec48b37e82b89787afd6a4c43457e1

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-64222
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/net/ethernet/marvell/octeontx2/nic/cn20k.c
	drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.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/e6e9bc0bf963662b7042048ab0281014625d4cb4
	https://git.kernel.org/stable/c/b92e7ea408b6f1144648909c9c49a55d245d7300
	https://git.kernel.org/stable/c/94192b0579333c3deee2441379aab8ca98fc2e6b
	https://git.kernel.org/stable/c/4c29603498b05c049dbbbc47e882f2fbf0193cd7
	https://git.kernel.org/stable/c/0488a0bb344fb1992853b60082acff6be8164d74
	https://git.kernel.org/stable/c/0d9b9d7dbef976ae7f855b6358f1d703014e96ea
	https://git.kernel.org/stable/c/c4b8c5d51632538b19ee01cf6d70cbceeefbd3ec
	https://git.kernel.org/stable/c/9b244c242bec48b37e82b89787afd6a4c43457e1
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.