# CVE-2024-26902: perf: RISCV: Fix panic on pmu overflow handler

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-04-17T10:27:51.042Z
- **Modified:** 2026-10-30T13:17:23.690Z

## Who should check

- Anyone running Linux \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< dbf3b0ed79abeb552df4f0d8a6d84cee48b5ee77; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 3ede8e94de6b834b48b0643385e66363e7a04be9; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 9f599ba3b9cc4bdb8ec1e3f0feddd41bf9d296d6; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 34b567868777e9fd39ec5333969728a7f0cf179c
- Anyone running Linux 5.18

## Description

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

perf: RISCV: Fix panic on pmu overflow handler

(1 \<\< idx) of int is not desired when setting bits in unsigned long
overflowed\_ctrs, use BIT() instead. This panic happens when running
'perf record -e branches' on sophgo sg2042.

\[  273.311852\] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000098
\[  273.320851\] Oops \[\#1\]
\[  273.323179\] Modules linked in:
\[  273.326303\] CPU: 0 PID: 1475 Comm: perf Not tainted 6.6.0-rc3+ \#9
\[  273.332521\] Hardware name: Sophgo Mango (DT)
\[  273.336878\] epc : riscv\_pmu\_ctr\_get\_width\_mask+0x8/0x62
\[  273.342291\]  ra : pmu\_sbi\_ovf\_handler+0x2e0/0x34e
\[  273.347091\] epc : ffffffff80aecd98 ra : ffffffff80aee056 sp : fffffff6e36928b0
\[  273.354454\]  gp : ffffffff821f82d0 tp : ffffffd90c353200 t0 : 0000002ade4f9978
\[  273.361815\]  t1 : 0000000000504d55 t2 : ffffffff8016cd8c s0 : fffffff6e3692a70
\[  273.369180\]  s1 : 0000000000000020 a0 : 0000000000000000 a1 : 00001a8e81800000
\[  273.376540\]  a2 : 0000003c00070198 a3 : 0000003c00db75a4 a4 : 0000000000000015
\[  273.383901\]  a5 : ffffffd7ff8804b0 a6 : 0000000000000015 a7 : 000000000000002a
\[  273.391327\]  s2 : 000000000000ffff s3 : 0000000000000000 s4 : ffffffd7ff8803b0
\[  273.398773\]  s5 : 0000000000504d55 s6 : ffffffd905069800 s7 : ffffffff821fe210
\[  273.406139\]  s8 : 000000007fffffff s9 : ffffffd7ff8803b0 s10: ffffffd903f29098
\[  273.413660\]  s11: 0000000080000000 t3 : 0000000000000003 t4 : ffffffff8017a0ca
\[  273.421022\]  t5 : ffffffff8023cfc2 t6 : ffffffd9040780e8
\[  273.426437\] status: 0000000200000100 badaddr: 0000000000000098 cause: 000000000000000d
\[  273.434512\] \[\<ffffffff80aecd98\>\] riscv\_pmu\_ctr\_get\_width\_mask+0x8/0x62
\[  273.441169\] \[\<ffffffff80076bd8\>\] handle\_percpu\_devid\_irq+0x98/0x1ee
\[  273.447562\] \[\<ffffffff80071158\>\] generic\_handle\_domain\_irq+0x28/0x36
\[  273.454151\] \[\<ffffffff8047a99a\>\] riscv\_intc\_irq+0x36/0x4e
\[  273.459659\] \[\<ffffffff80c944de\>\] handle\_riscv\_irq+0x4a/0x74
\[  273.465442\] \[\<ffffffff80c94c48\>\] do\_irq+0x62/0x92
\[  273.470360\] Code: 0420 60a2 6402 5529 0141 8082 0013 0000 0013 0000 (6d5c) b783
\[  273.477921\] ---\[ end trace 0000000000000000 \]---
\[  273.482630\] Kernel panic - not syncing: Fatal exception in interrupt

## Affected and fixed versions

- Linux: \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< dbf3b0ed79abeb552df4f0d8a6d84cee48b5ee77; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 3ede8e94de6b834b48b0643385e66363e7a04be9; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 9f599ba3b9cc4bdb8ec1e3f0feddd41bf9d296d6; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 34b567868777e9fd39ec5333969728a7f0cf179c (cvelist)
- Linux: 5.18 (cvelist)

## Mitigation

- Upgrade Linux to 34b567868777e9fd39ec5333969728a7f0cf179c or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-26902. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-26902.md
Affected: Linux >= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, < dbf3b0ed79abeb552df4f0d8a6d84cee48b5ee77; >= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, < 3ede8e94de6b834b48b0643385e66363e7a04be9; >= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, < 9f599ba3b9cc4bdb8ec1e3f0feddd41bf9d296d6; >= 4905ec2fb7e6421c14c9fb7…
Fixed in: Linux 3ede8e94de6b834b48b0643385e66363e7a04be9, Linux 9f599ba3b9cc4bdb8ec1e3f0feddd41bf9d296d6, Linux 34b567868777e9fd39ec5333969728a7f0cf179c

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-26902 being exploited?

There is no confirmed exploitation: CVE-2024-26902 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-26902?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-26902?

Linux \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< dbf3b0ed79abeb552df4f0d8a6d84cee48b5ee77; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 3ede8e94de6b834b48b0643385e66363e7a04be9; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 9f599ba3b9cc4bdb8ec1e3f0feddd41bf9d296d6; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 34b567868777e9fd39ec5333969728a7f0cf179c; Linux 5.18.

### Is there a fix for CVE-2024-26902?

Yes. Fixed in Linux 3ede8e94de6b834b48b0643385e66363e7a04be9, Linux 9f599ba3b9cc4bdb8ec1e3f0feddd41bf9d296d6, Linux 34b567868777e9fd39ec5333969728a7f0cf179c. Upgrade Linux to 34b567868777e9fd39ec5333969728a7f0cf179c or later.

### How do I check if I'm affected by CVE-2024-26902?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/3ede8e94de6b834b48b0643385e66363e7a04be9>
- patch: <https://git.kernel.org/stable/c/9f599ba3b9cc4bdb8ec1e3f0feddd41bf9d296d6>
- patch: <https://git.kernel.org/stable/c/34b567868777e9fd39ec5333969728a7f0cf179c>
- other: <https://git.kernel.org/stable/c/dbf3b0ed79abeb552df4f0d8a6d84cee48b5ee77>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-26902>

HTML: <https://flawdb.com/CVE-2024-26902> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-26902>
