CVE-2025-40081
Description
In the Linux kernel, the following vulnerability has been resolved:
perf: arm_spe: Prevent overflow in PERF_IDX2OFF()
Cast nr_pages to unsigned long to avoid overflow when handling large AUX buffer sizes (>= 2 GiB).
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Integer overflow in arm_spe PERF_IDX2OFF() when using AUX buffers >= 2 GiB, fixed by casting nr_pages to unsigned long.
Vulnerability
Overview
The Linux kernel's ARM Statistical Profiling Extension (SPE) driver contains an integer overflow vulnerability in the PERF_IDX2OFF() macro. This macro computes an offset using the nr_pages variable, which represents the number of pages in the AUX buffer. When the buffer size is 2 GiB or larger, the multiplication in the offset calculation can overflow a 32-bit integer, producing an incorrect result [1].
Exploitation
Conditions
An attacker would need the ability to configure a large AUX buffer (≥ 2 GiB) for a perf event on an ARM system with SPE hardware support. This requires privileges such as CAP_PERFMON or root access. No network access is necessary—the attack is local. The overflow occurs during buffer setup, before data collection starts.
Impact
The miscalculated offset can cause the driver to write to or read from an incorrect memory location. This may lead to memory corruption, denial of service, or information disclosure. The exact impact depends on system memory layout and kernel hardening, but the overflow could be leveraged by an unprivileged user to compromise system stability or leak sensitive data [1].
Mitigation
The fix, committed to the Linux kernel stable tree, casts nr_pages to unsigned long before the arithmetic operation, preventing overflow for any buffer size up to the maximum supported by the architecture [1]. Users should apply the patch or update to a kernel version containing the commit.
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
1Patches
8656e9a5d69ac9c045d4501f75d01f2b815687500384d3c95379cae2cb9821a19ba8e1f4fe516cfd19b0fa29fea30dd93Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- git.kernel.org/stable/c/1a19ba8e1f4ff24ece8ca69b79df8442c431db90nvd
- git.kernel.org/stable/c/379cae2cb982f571cda9493ac573ab71125fd299nvd
- git.kernel.org/stable/c/5d01f2b81568289443d22f1e13a363f829de6343nvd
- git.kernel.org/stable/c/656e9a5d69acdd1b20462f4a33378b90ddcb9626nvd
- git.kernel.org/stable/c/7500384d3c9587593d75ded3b006835e7aa73ef8nvd
- git.kernel.org/stable/c/9c045d4501f7f70724a3bbb561f4f22d292bbfe6nvd
- git.kernel.org/stable/c/a29fea30dd93da16652930162b177941abd8c75envd
- git.kernel.org/stable/c/e516cfd19b0f4c774a57b17fb43a7f41991f0735nvd
News mentions
0No linked articles in our index yet.