CVE-2026-97587

perf: RISC-V: store available counter mask as bitmap

Published Sep 25, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

perf: RISC-V: store available counter mask as bitmap

The available-counter mask was a single unsigned long, but iteration
uses RISCV_MAX_COUNTERS, which is 64. On RV32 that reads past the object.
Filling with an unsigned-long bit at index 32 and above is also wrong.

Use DECLARE_BITMAP and set_bit/bitmap helpers. Walk each bitmap word
into CFG_MATCH when checking events, when allocating an index, and when
stopping all counters. Set the counter base to i times BITS_PER_LONG.
Share the CFG_MATCH ecall through a small helper so the 32-bit argument
split is not duplicated. On qemu-system-riscv32 the probe bitmap has bits
above XLEN set, so the first word alone is not enough.

[pjw@kernel.org: updated to apply; fixed checkpatch.pl issues]

Analysis

AI-generated

Technical impact

The Linux kernel’s performance monitoring subsystem for RISC‑V contains a bug where the available‑counter mask was stored as a single unsigned long, but the code later iterates over a 64‑bit bitmap. On 32‑bit RISC‑V processors this causes the kernel to read and write past the allocated memory. The out‑of‑bounds read/write can expose kernel memory contents, potentially leaking confidential data, or corrupt internal structures, leading to system instability or crashes. The vulnerability is a classic out‑of‑bounds read/write flaw (CWE‑125). The likely attack vector is the perf interface on affected 32‑bit RISC‑V kernels, where a malicious user could supply crafted performance event parameters to trigger the counter mask overflow. Based on the description, it is inferred that an attacker would need local or privileged access to submit such events.

Affected Systems

All 32‑bit RISC‑V builds of the Linux kernel that enable CONFIG_RISCV_PERF and run the perf interface, including any kernel version prior to the commits referenced. No specific version numbers are listed, so all kernels lacking the fix are considered affected.

Risk and Exploitability

The EPSS score is less than 1%, indicating a very low exploitation probability. The CVSS score of 5.5 indicates moderate severity. The vulnerability is not listed in the CISA KEV catalog, suggesting no widely known exploits. However, the defect exists in kernel space, so an attacker with local or privileged access to the perf interface can trigger the out‑of‑bounds read/write. The likely attack vector is through the perf interface on 32‑bit RISC‑V kernels, where an attacker can supply crafted performance event parameters to cause the counter mask overflow. The potential for kernel data leakage or a crash suggests a moderate to high risk for compromised or locally privileged users.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the kernel to a release that incorporates the referenced patches or apply the specific commit changes directly.
  • If a kernel update cannot be performed immediately, rebuild or reconfigure the kernel with CONFIG_RISCV_PERF disabled to remove the vulnerable subsystem.
  • Enforce stricter access controls on the perf interface, such as sandboxing, SELinux or AppArmor rules, or container isolation, to limit which processes may invoke perf events on affected systems.

Generated by OpenCVE AI on October 1, 2026 at 09:17 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4817-1 linux-6.12 security update
Debian DSA Debian DSA DSA-6528-1 linux security update
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9020-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9022-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9023-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9024-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9025-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9026-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9039-1 Linux kernel (Azure CVM) vulnerabilities
Ubuntu USN Ubuntu USN USN-9040-1 Linux kernel (Low Latency NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-9066-1 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-9091-1 Linux kernel (NVIDIA Tegra) vulnerabilities
Ubuntu USN Ubuntu USN USN-9160-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9183-1 Linux kernel (FIPS) vulnerabilities
Ubuntu USN Ubuntu USN USN-9192-1 Linux kernel (NVIDIA) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-124
CWE-787
Type Values Removed Values Added
Weaknesses CWE-125
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-124
CWE-787
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: perf: RISC-V: store available counter mask as bitmap The available-counter mask was a single unsigned long, but iteration uses RISCV_MAX_COUNTERS, which is 64. On RV32 that reads past the object. Filling with an unsigned-long bit at index 32 and above is also wrong. Use DECLARE_BITMAP and set_bit/bitmap helpers. Walk each bitmap word into CFG_MATCH when checking events, when allocating an index, and when stopping all counters. Set the counter base to i times BITS_PER_LONG. Share the CFG_MATCH ecall through a small helper so the 32-bit argument split is not duplicated. On qemu-system-riscv32 the probe bitmap has bits above XLEN set, so the first word alone is not enough. [pjw@kernel.org: updated to apply; fixed checkpatch.pl issues]
Title perf: RISC-V: store available counter mask as bitmap
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 30, 2026, 12:37 PM
Reserved
Sep 24, 2026, 4:01 PM
Status
Received
Published
Sep 25, 2026, 11:17 AM
Modified
Oct 30, 2026, 1:21 PM
Severity
Moderate
Public date
Sep 25, 2026, 12:00 AM