VYPR
Unrated severityNVD Advisory· Published Nov 12, 2025· Updated Apr 15, 2026

CVE-2025-40112

CVE-2025-40112

Description

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

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

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 and a broken epilogue in the exception handlers. This will prevent crashes and ensure correct return values of copy_from_user and copy_to_user in the faulting case. The behaviour of memcpy stays unchanged.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A fix in the Linux kernel for SPARC Niagara corrects exception handlers in copy_from_user and copy_to_user, preventing crashes and ensuring accurate return values on fault.

Vulnerability

Description

CVE-2025-40112 addresses a bug in the Linux kernel's SPARC architecture, specifically for Niagara processors. The issue lies in the exception handlers added to copy_from_user and copy_to_user functions. These handlers are invoked when a fault occurs during user-space memory access, and they are responsible for calculating the number of bytes not-yet-copied bytes and returning from the function. However, the initial implementation contained bad calculations and a broken epilogue in the exception handlers, leading to incorrect return values and potential system crashes [1][2][2][3].

Exploitation and

Impact

An attacker who can trigger a fault during a copy operation from or to user space could exploit this flaw. The incorrect exception handling could cause the kernel to miscalculate the number of bytes not copied, potentially leading to memory corruption or information leaks. The vulnerability could be triggered by a user-space program that causes a page fault during a copy operation, for example by accessing an invalid memory region. The impact includes system instability (crashes) and incorrect return values from the copy functions, which could be leveraged for further exploitation [1][2][3].

Mitigation

The fix is included in the Linux kernel stable tree. Users should apply the relevant kernel patches to ensure correct exception handling on SPARC Niagara systems. The memcpy function is not affected by this issue [1][2][3].

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2

Patches

8

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

8

News mentions

0

No linked articles in our index yet.