CVE-2025-40124: sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III
In the Linux kernel, the following vulnerability has been resolved:
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III
Anthony Yznaga tracked down that a BUG_ON in ext4 code with large folios
enabled resulted from copy_from_user() returning impossibly large values
greater than the size to be copied. This lead to __copy_from_iter()
returning impossible values instead of the actual number of bytes it was
able to copy.
The BUG_ON has been reported in
https://lore.kernel.org/r/b14f55642207e63e907965e209f6323a0df6dcee.camel@physik.fu-berlin.de
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. The exception handlers expect that
%o2 has already been masked during the bulk copy loop, but the masking was
performed after that loop. This will fix the return value of copy_from_user
and copy_to_user in the faulting case. The behaviour of memcpy stays
unchanged.
Security readout for executives and security teams
Plain-English summary
A Linux kernel fault-handling bug on UltraSPARC III systems can report an impossible number of uncopied bytes when moving data between user and kernel memory. This can corrupt higher-level error accounting and has triggered an ext4 kernel assertion. The supplied CVSS score is 7.8, but exposure is limited to affected SPARC systems and requires local low-privileged access.
Executive priority
Treat this as high priority where UltraSPARC III systems remain operational, especially multi-user or externally administered hosts. Prioritize inventory first because architecture sharply limits exposure. Systems on other architectures are not shown affected by the supplied evidence. There is no documented active exploitation, so emergency organization-wide Linux action is unsupported.
Technical view
The SPARC copy_from_user() and copy_to_user() exception handlers calculate remaining bytes from register %o2. On UltraSPARC III, they assumed %o2 was already masked, although masking occurred after the bulk-copy loop. A memory fault could therefore produce an oversized return value, propagate impossible values through __copy_from_iter(), and trigger safety checks such as the reported ext4 BUG_ON.
Likely exposure
Likely exposure is confined to systems running affected Linux kernels on UltraSPARC III hardware. The supplied record identifies affected releases from 4.9 through 6.18, with several fixed stable releases and commits, but vendor backports may change status. Other architectures should not be treated as affected from this evidence.
Exploitation context
The CVSS vector describes a local, low-complexity issue requiring low privileges and no user interaction. CISA KEV status is false, and the supplied evidence does not document active exploitation or weaponization. The documented real-world symptom is a kernel BUG_ON involving ext4 large folios, not a demonstrated confidentiality or integrity compromise.
Researcher notes
The failure is inaccurate residual-length reporting during fault handling, not a change to memcpy behavior. The supplied record assigns no CWE. Researchers should validate architecture, exact kernel lineage, and backport status before declaring exposure. The reported ext4 assertion demonstrates impact, while broader confidentiality and integrity consequences are represented by CVSS rather than a documented exploit.
Mitigation direction
Update to a vendor-supported kernel containing the applicable cited stable fix.
Confirm distribution kernels include the fix, because package versions may use backports.
Prioritize affected UltraSPARC III production systems accessible to untrusted local users.
Restrict unnecessary local accounts until affected systems are remediated.
Validation and detection
Inventory Linux kernel versions and hardware architecture across SPARC systems.
Confirm whether each system uses UltraSPARC III hardware.
Compare kernel provenance against affected releases and cited stable fix commits.
Check vendor advisories or package changelogs for an explicit backport.
Review kernel logs for copy-related faults, ext4 BUG_ON events, or unexplained crashes.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-40124 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
9Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.