Skip to contentSkip to conversation

CVE-2026-72489: staging: nvec: fix use-after-free in nvec_rx_completed()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Aug 15

lore
Share & tools
lore
#0 lore raw

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

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

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

staging: nvec: fix use-after-free in nvec_rx_completed()

In nvec_rx_completed(), when an incomplete RX transfer is detected, nvec_msg_free() is called to return the message back to the pool by clearing its 'used' atomic flag. Immediately after this, the code accesses nvec->rx->data[0] to check the message type.

Since nvec_msg_free() marks the pool slot as available via atomic_set(), any concurrent or subsequent call to nvec_msg_alloc() could claim that same slot and overwrite its data[] array. Reading nvec->rx->data[0] after freeing the message is therefore a use-after-free.

Fix this by saving the message type byte before calling nvec_msg_free(), then using the saved value for the battery quirk check.

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

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

	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 5.10.261 with commit 6b2ea886ebdae44a2394029844a4e78f58e1587d
	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 5.15.212 with commit a37625c7b688fcf68a54263528eccbabfd7fa17a
	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 6.1.178 with commit 9f7fe4165a1f1014bdadc8e744c0fd3c2d8c0b89
	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 6.6.145 with commit 08626fcfe12308ca3f8b22c538ba7dee0b2dce7a
	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 6.12.97 with commit f19a5bc059051143c489dd6f79a0f9c3bfd13aea
	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 6.18.40 with commit bb3d592c7d6c4ec8ac6640c690ca13298e7e8e90
	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 7.1.5 with commit 5de04caa46b635e180cecbd164e333eca535db94
	Issue introduced in 3.2 with commit d6bdcf2e1019351cbc176e963b7756766bdd8721 and fixed in 7.2-rc1 with commit 26813881181deb3a32fbb59eadb2599cbe8423f6

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

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/staging/nvec/nvec.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/6b2ea886ebdae44a2394029844a4e78f58e1587d
	https://git.kernel.org/stable/c/a37625c7b688fcf68a54263528eccbabfd7fa17a
	https://git.kernel.org/stable/c/9f7fe4165a1f1014bdadc8e744c0fd3c2d8c0b89
	https://git.kernel.org/stable/c/08626fcfe12308ca3f8b22c538ba7dee0b2dce7a
	https://git.kernel.org/stable/c/f19a5bc059051143c489dd6f79a0f9c3bfd13aea
	https://git.kernel.org/stable/c/bb3d592c7d6c4ec8ac6640c690ca13298e7e8e90
	https://git.kernel.org/stable/c/5de04caa46b635e180cecbd164e333eca535db94
	https://git.kernel.org/stable/c/26813881181deb3a32fbb59eadb2599cbe8423f6