Skip to contentSkip to conversation

CVE-2025-38342: software node: Correct a OOB check in software_node_get_reference_args()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 10, 2025

lore
Share & tools
lore
#0 lore raw

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

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

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

software node: Correct a OOB check in software_node_get_reference_args()

software_node_get_reference_args() wants to get @index-th element, so the property value requires at least '(index + 1) * sizeof(*ref)' bytes but that can not be guaranteed by current OOB check, and may cause OOB for malformed property.

Fix by using as OOB check '((index + 1) * sizeof(*ref) > prop->length)'.

The Linux kernel CVE team has assigned CVE-2025-38342 to this issue.

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

	Fixed in 5.10.239 with commit 142acd739eb6f08c148a96ae8309256f1422ff4b
	Fixed in 5.15.186 with commit 56ce76e8d406cc72b89aee7931df5cf3f18db49d
	Fixed in 6.1.142 with commit 9324127b07dde8529222dc19233aa57ec810856c
	Fixed in 6.6.95 with commit f9397cf7bfb680799fb8c7f717c8f756384c3280
	Fixed in 6.12.35 with commit 4b3383110b6df48e0ba5936af2cb68d5eb6bd43b
	Fixed in 6.15.4 with commit 7af18e42bdefe1dba5bcb32555a4d524fd504939
	Fixed in 6.16-rc1 with commit 31e4e12e0e9609850cefd4b2e1adf782f56337d6

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-2025-38342

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/base/swnode.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/142acd739eb6f08c148a96ae8309256f1422ff4b
	https://git.kernel.org/stable/c/56ce76e8d406cc72b89aee7931df5cf3f18db49d
	https://git.kernel.org/stable/c/9324127b07dde8529222dc19233aa57ec810856c
	https://git.kernel.org/stable/c/f9397cf7bfb680799fb8c7f717c8f756384c3280
	https://git.kernel.org/stable/c/4b3383110b6df48e0ba5936af2cb68d5eb6bd43b
	https://git.kernel.org/stable/c/7af18e42bdefe1dba5bcb32555a4d524fd504939
	https://git.kernel.org/stable/c/31e4e12e0e9609850cefd4b2e1adf782f56337d6