Skip to contentSkip to conversation

CVE-2025-40126: sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 12, 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:

sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC

The referenced commit introduced exception handlers on user-space memory references in copy_from_user and copy_to_user. These handlers return from the respective function and calculate the remaining bytes left to copy using the current register contents. This commit fixes a couple of bad calculations. This will fix the return value of copy_from_user and copy_to_user in the faulting case. The behaviour of memcpy stays unchanged.

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

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

	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 5.4.301 with commit 0bf3dc3a2156f1c5ddaba4b85d09767874634114
	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 5.10.246 with commit 41c18baee66134e6ef786eb075c1b6adb22432b0
	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 5.15.195 with commit 59424dc0d0e044b2eb007686a4724ddd91d57db5
	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 6.1.156 with commit 9b137f277cc3297044aabd950f589e505d30104c
	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 6.6.112 with commit 674ff598148a28bae0b5372339de56f2abf0b1d1
	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 6.12.53 with commit 7de3a75bbc8465d816336c74d50109e73501efab
	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 6.17.3 with commit 57c278500fce3cd4e1c540700c0b05426a958393
	Issue introduced in 4.9 with commit cb736fdbb208eb3420f1a2eb2bfc024a6e9dcada and fixed in 6.18-rc1 with commit 4fba1713001195e59cfc001ff1f2837dab877efb
	Issue introduced in 4.4.34 with commit 1731d90d8a558ecb20cdee0c2c001ae8e15c251d
	Issue introduced in 4.8.10 with commit b0580eadc19ff3a617a7d07cfaf2a985153c114e

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

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:
arch/sparc/lib/U1memcpy.S

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/0bf3dc3a2156f1c5ddaba4b85d09767874634114
	https://git.kernel.org/stable/c/41c18baee66134e6ef786eb075c1b6adb22432b0
	https://git.kernel.org/stable/c/59424dc0d0e044b2eb007686a4724ddd91d57db5
	https://git.kernel.org/stable/c/9b137f277cc3297044aabd950f589e505d30104c
	https://git.kernel.org/stable/c/674ff598148a28bae0b5372339de56f2abf0b1d1
	https://git.kernel.org/stable/c/7de3a75bbc8465d816336c74d50109e73501efab
	https://git.kernel.org/stable/c/57c278500fce3cd4e1c540700c0b05426a958393
	https://git.kernel.org/stable/c/4fba1713001195e59cfc001ff1f2837dab877efb